xBrowse and empty array
Posted: Fri Jun 06, 2008 9:19 am
Hi,
the xBrowse crash when the array is empty.
Is there any solution ? With the old tcbrowse all runs fine.
Sample code:
#include "FiveWin.ch"
#include "xbrowse.ch"
function Main()
DEFINE BITMAP oGreen FILENAME "16green.bmp"
DEFINE BITMAP oRed FILENAME "16red.bmp"
aNames:=array(0,5)
** aadd(aNames,{1,"Marc1","4th Floor","Queens House",oRed})
** aadd(aNames,{2,"Marc2","4th Floor","Queens House",oRed})
** aadd(aNames,{3,"Marc3","4th Floor","Queens House",oGreen})
** aadd(aNames,{4,"Marc4","4th Floor","Queens House",oGreen})
DEFINE dialog oDlg TITLE "xBrowse tests" FROM 5,5 TO 40,80
@1,1 XBROWSE oBrw ARRAY aNames of oDlg AUTOSORT
ADD COLUMN TO XBROWSE oBrw DATA ARRAY ELEM 1;
HEADER "Num" SIZE 30 LEFT order 2
ADD COLUMN TO XBROWSE oBrw DATA ARRAY ELEM 2;
HEADER "Name" SIZE 80 order 2
oBrw:CreateFromCode()
ACTIVATE dialog oDlg
the xBrowse crash when the array is empty.
Is there any solution ? With the old tcbrowse all runs fine.
Sample code:
#include "FiveWin.ch"
#include "xbrowse.ch"
function Main()
DEFINE BITMAP oGreen FILENAME "16green.bmp"
DEFINE BITMAP oRed FILENAME "16red.bmp"
aNames:=array(0,5)
** aadd(aNames,{1,"Marc1","4th Floor","Queens House",oRed})
** aadd(aNames,{2,"Marc2","4th Floor","Queens House",oRed})
** aadd(aNames,{3,"Marc3","4th Floor","Queens House",oGreen})
** aadd(aNames,{4,"Marc4","4th Floor","Queens House",oGreen})
DEFINE dialog oDlg TITLE "xBrowse tests" FROM 5,5 TO 40,80
@1,1 XBROWSE oBrw ARRAY aNames of oDlg AUTOSORT
ADD COLUMN TO XBROWSE oBrw DATA ARRAY ELEM 1;
HEADER "Num" SIZE 30 LEFT order 2
ADD COLUMN TO XBROWSE oBrw DATA ARRAY ELEM 2;
HEADER "Name" SIZE 80 order 2
oBrw:CreateFromCode()
ACTIVATE dialog oDlg