TBrowseArray:SetArray() clears all previus settings
Publicado: Jue Ago 17, 2006 11:58 am
Hi,
I have TbrowsArray component on form with 5 columns and defined headers, and want to
display the dbf structure with the leading order number of the field. The array with
structure contains 6 columns. The sixth is a logical value, which I can`t show.
This method does the job:
*****************************************
METHOD OpenDbfFile() CLASS HlavneOkno
LOCAL cInputFile,aStru,i
cInputFile := FileOpenDlg(Self,"Select file","D:PROJEKTLEKAREN","DBF
files|*.dbf",1)
USE (cInputFile) NEW SHARED
aStru := DBSTRUCT()
* Add 2 columns to the array. The first is the order number, the last is logical flag
FOR i := 1 TO LEN(aStru)
ASIZE(aStru,LEN(aStru)+2)
AINS(aStru,1) && Order no
aStru[i,1] := i
AINS(aStru,6)
aStru[i,6] := .F. && logical flag
NEXT
::oArrayBrowse1:SetArray(aStru)
RETURN Nil
*************************************
When this method is called at the first time, everything works ok. The browser displays
the defined 5 columns with defined headers. When the method is called repeatedly, the
browser displays all 6 columns with blank headers.
Can anybody tell me why?
Gejza Horvath
I have TbrowsArray component on form with 5 columns and defined headers, and want to
display the dbf structure with the leading order number of the field. The array with
structure contains 6 columns. The sixth is a logical value, which I can`t show.
This method does the job:
*****************************************
METHOD OpenDbfFile() CLASS HlavneOkno
LOCAL cInputFile,aStru,i
cInputFile := FileOpenDlg(Self,"Select file","D:PROJEKTLEKAREN","DBF
files|*.dbf",1)
USE (cInputFile) NEW SHARED
aStru := DBSTRUCT()
* Add 2 columns to the array. The first is the order number, the last is logical flag
FOR i := 1 TO LEN(aStru)
ASIZE(aStru,LEN(aStru)+2)
AINS(aStru,1) && Order no
aStru[i,1] := i
AINS(aStru,6)
aStru[i,6] := .F. && logical flag
NEXT
::oArrayBrowse1:SetArray(aStru)
RETURN Nil
*************************************
When this method is called at the first time, everything works ok. The browser displays
the defined 5 columns with defined headers. When the method is called repeatedly, the
browser displays all 6 columns with blank headers.
Can anybody tell me why?
Gejza Horvath