In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

TBrowseArray:SetArray() clears all previus settings

Xailer English public forum
Responder
Gejza Horvath
Mensajes: 281
Registrado: Mar Ago 15, 2006 1:50 pm

TBrowseArray:SetArray() clears all previus settings

Mensaje 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
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

TBrowseArray:SetArray() clears all previus settings

Mensaje por jfgimenez »

Gejza,
Please, send us a small and self contained sample to test.
--
Regards,
Jose F. Gimenez
http://www.xailer.com
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Gejza Horvath
Mensajes: 281
Registrado: Mar Ago 15, 2006 1:50 pm

TBrowseArray:SetArray() clears all previus settings

Mensaje 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)Â
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

TBrowseArray:SetArray() clears all previus settings

Mensaje 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
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Responder