Página 1 de 1

TBrowseArray:SetArray() clears all previus settings

Publicado: Jue Ago 17, 2006 11:58 am
por Gejza Horvath
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

TBrowseArray:SetArray() clears all previus settings

Publicado: Jue Ago 17, 2006 1:42 pm
por jfgimenez
Gejza,
Please, send us a small and self contained sample to test.
--
Regards,
Jose F. Gimenez
http://www.xailer.com

TBrowseArray:SetArray() clears all previus settings

Publicado: Jue Ago 17, 2006 2:08 pm
por Gejza Horvath
Jose,
here is the whole project, try the File-Open command and look at oArrayBrowse1.
Please advise:
how can I set a filter into oArrayBrowse1 to show only the rows, where aRow[6] = .F.?
I can`t find anything in help file about filtering in TArrayBrowse. The idea is:
1. Open dbf file and show his structure in Browser1
2. Select field in Browser1, push the => button, add the selected item to Browser2
3. In the selected row in Browser1:Array set the 6th element to .T. and hide it
4. Pressing the <= button delete the selected item in Browser2, set the 6th element for
the corresponding item in Browse1:Array to .F. and show it again.
Thanks
Gejza
"Jose F. Gimenez" <jfgimenez@wanadoo.es> pí¹e v diskusním pøíspìvku
news:44e45620$[email=1@news.xailer.com...]1@news.xailer.com...[/email]
> Gejza,
>
> Please, send us a small and self contained sample to test.
>
>
> --
> Regards,
>
> Jose F. Gimenez
> http://www.xailer.com
>
>


Attached files DBFCSV.rar (8.3 KB)Â

TBrowseArray:SetArray() clears all previus settings

Publicado: Jue Ago 17, 2006 7:10 pm
por jfgimenez
Gejza,
> here is the whole project, try the File-Open command and look at
> oArrayBrowse1.
well, I now see the problem. The solution is simple: just add the sixth
column, and make it invisible (:lVisible := .F.)
> how can I set a filter into oArrayBrowse1 to show only the rows, where
> aRow[6] = .F.?
> I can`t find anything in help file about filtering in TArrayBrowse. The
> idea is:
>
> 1. Open dbf file and show his structure in Browser1
> 2. Select field in Browser1, push the => button, add the selected item to
> Browser2
> 3. In the selected row in Browser1:Array set the 6th element to .T. and
> hide it
> 4. Pressing the <= button delete the selected item in Browser2, set the
> 6th element for the corresponding item in Browse1:Array to .F. and show it
> again.
There is no direct way to do it. You have to add / delete rows to each array
when needed. That is, when the user click =>, then delete the selected row
from the first array and add it to the second one; and viceversa.
--
Regards,
Jose F. Gimenez
http://www.xailer.com