If I have a xbrowse I must populate 3 array
Local nLen := Len( oGrid:aCols )
Local aCampos [ nLen ]
Local aTitulos[ nLen ]
Local aTipos [ nLen ]
FOR n = 1 TO nLen
aCampos [ n ]:= alltrim( cValToChar( (oGrid:cAlias)->( Fieldname( oGrid:aCols[ n ]:nCreationOrder ) ) ))
aTitulos [ n ]:= oGrid:aCols[ n ]:cHeader
aTipos [ n ]:= oGrid:aCols[ n ]:cDataType
NEXT
For the aCampos array it run bad because it take fields of database from first field
If I have 14 colums on xbrowse it take the first 14 fields and not the exactly fields of relative column
How I can to save on aCampos array the fileds right ?
Know the exactly field from xbrowse
- Silvio.Falconi
- Posts: 7133
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Know the exactly field from xbrowse
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Re: Know the exactly field from xbrowse
Hello Silvio
Local R:=oBRW:nArrayAt // rigo array
Local Z:=oBRW:nCOLSEL // colonna selezionata
Local oCOL:=oBRW:aCols[Z] // txcolonna
Local C:=oCOL:nArrayCol // indice colonna array - come ARR_X[R][H]
Local nDATO:=oCOL:Value() // dato dentro la cella
Local nDATO:=ARR_X[R][C]
Best Regards
Santo
Local R:=oBRW:nArrayAt // rigo array
Local Z:=oBRW:nCOLSEL // colonna selezionata
Local oCOL:=oBRW:aCols[Z] // txcolonna
Local C:=oCOL:nArrayCol // indice colonna array - come ARR_X[R][H]
Local nDATO:=oCOL:Value() // dato dentro la cella
Local nDATO:=ARR_X[R][C]
Best Regards
Santo
- Silvio.Falconi
- Posts: 7133
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: Know the exactly field from xbrowse
Hello Santo,
I call a function ang give to this function only the object of xbrowse
sample test1(ogrid)
on this function I must create the array for fields, header and type
I hope you understood
In italian
devo sapere quali sono i nomi dei campi delle colonne della tabella passata alla funzione
il comando alltrim( cValToChar( (oGrid:cAlias)->( Fieldname( oGrid:aCols[ n ]:nCreationOrder ) ) ))
restituisce i campi partendo dall'inizio cioè dal primo campo del database
se i campi che ho nella tabella sono 14 lui prende solo i primi 14 campi e non quelli effettivamente posti in tabella
I call a function ang give to this function only the object of xbrowse
sample test1(ogrid)
on this function I must create the array for fields, header and type
I hope you understood
In italian
devo sapere quali sono i nomi dei campi delle colonne della tabella passata alla funzione
il comando alltrim( cValToChar( (oGrid:cAlias)->( Fieldname( oGrid:aCols[ n ]:nCreationOrder ) ) ))
restituisce i campi partendo dall'inizio cioè dal primo campo del database
se i campi che ho nella tabella sono 14 lui prende solo i primi 14 campi e non quelli effettivamente posti in tabella
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: Know the exactly field from xbrowse
oCol:cExpr gives the fieldname.
Note: If you created xbrowse with full command syntax
Note: If you created xbrowse with full command syntax
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Silvio.Falconi
- Posts: 7133
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: Know the exactly field from xbrowse
I'm creating a filter function to create filters string
I created xbrowse with
I created xbrowse with
Code: Select all | Expand
Function test()
aCampi := { "CODCF", "RAGSOC", "RAGSOC1", "INDIR" }
aNomi:= {"Codice","Ragione Sociale","Ragione Sociale2","Indirizzo Legale"}
aSizes:= {50,250 ,200,100 }
USE CLIENTI ALIAS CLIENTI NEW
LookUp("Clienti",aCampi,aNomi,aSizes,35.7,105,"Anagrafica clienti")
RETURN NIL
ON lookup function there is a xbrowse and a buttonbar
@ 15.6, 0 XBROWSE oBrw OF oDlgLook SIZE -1,-20 PIXEL ;
DATASOURCE cdbf ;
COLUMNS aCampi HEADERS aNomi COLSIZES aSizes
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: Know the exactly field from xbrowse
Yes, in this case, oCol:cExpr returns the fieldname
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Silvio.Falconi
- Posts: 7133
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: Know the exactly field from xbrowse
thanks now run ok
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com