Dear All,
I am normally using TwBrowse Listbox with normal syntax of REDEFINE LISTBOX.... But in a typical situation, I want to assign columns to the listbox programmatically. I saw that it is being passed as second parameter as Code block. My data is in an array and I want to pass all the columns as field for the listbox.
e.g. {|| { oReport:ArrData[nItem,1],oReport:ArrData[nItem,2] } }
How can I assing columns in the code block in a loop ?
I hope somebody understand my problem and give some suggestion. I have difficulty in explaining my problem.
With best regards,
Milan.
TwBrowse question
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
-
- Posts: 115
- Joined: Mon Oct 17, 2005 4:42 am
- Location: India
Dear Antonio,
My following code do not give desired result :
nItem := 1
REDEFINE LISTBOX oBrw FIELDS RetRecord(oReport:ArrData, nItem) ;
COLSIZES 50, 80;
HEADERS 'Code', 'Name';
FONT oFont ;
UPDATE ;
ID LBREPORT OF oDlg
............
FUNCTION RetRecord(aArrData, nItem)
LOCAL i, aRetVal := {}
FOR i = 1 TO len(aArrData[nItem])
AADD (aArrData, aArrData[nItem, i])
NEXT
RETURN aRetVal
What am I doing wrong ?
TIA
Milan.
My following code do not give desired result :
nItem := 1
REDEFINE LISTBOX oBrw FIELDS RetRecord(oReport:ArrData, nItem) ;
COLSIZES 50, 80;
HEADERS 'Code', 'Name';
FONT oFont ;
UPDATE ;
ID LBREPORT OF oDlg
............
FUNCTION RetRecord(aArrData, nItem)
LOCAL i, aRetVal := {}
FOR i = 1 TO len(aArrData[nItem])
AADD (aArrData, aArrData[nItem, i])
NEXT
RETURN aRetVal
What am I doing wrong ?
TIA
Milan.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: