I wanted to convert this browse for easy reading and changing data, so that I don't need to count the fields in the source before editing.
I can do it with 3 times a single array's in a for next loop, but I wanted a chalenge...
Do it with Multi array and aEval, since I see aEval and Dbeval very ofthen.
I have to admit, I'ts not working and a sample I haven't found.
So here I'm...
What I want to change
- Code: Select all Expand view
@ 590,10 XBROWSE oBrw4 SIZE 1420,220 ;
PIXEL OF oWnd font oFont3;
DATASOURCE "MASTER" ;
COLUMNS "Selection","Code","Naam","lev_naam","lev_ref","fab_naam","fab_ref","Pagina","cat_main","Cat_sub1","Bruto","brutoKor","Geldigvan","geldigtot","Kleuren","Maten","picture","memo","filename" ;
HEADERS 'Sel',"Code",'Naam',"Lever","levCode","Fabrikant","FabCode","Pag",'Cat_Main',"Cat_Sub","Bruto","Kor","Van","Tot","Kleuren","Maten","picture","memo","Database";
COLSIZES 30,60,180,60,60,60,60,40,60,60,40,40,60,60,80,80,80,80,80;
autosort CELL LINES FOOTERS NOBORDER fastedit;
ON CHANGE ( ;
If( Empty( oBrw4:SelectedCol():cOrder ), ;
( oBrw4:SelectedCol():SetOrder(), oBrw4:seek(""), oBrw4:Refresh() ), ;
nil ) )
into something like this :
- Code: Select all Expand view
aSpec := { ;
{ 1, "Selection","Sel" , 30 }, ;
{ 2, "Code", "Code" , 60 }, ;
{ 3, "Naam", "Naam" , 180 }, ;
enz....
//AEVAL( aSpec , {|a| AINS( aFields, 3, 'x' ) })
//AEVAL( aSpec , {|a| AINS( aHeaders, 4, 'x' ) })
//AEVAL( aSpec , {|a| AINS( aSizes, 4, 'x' ) })
@ 90,20 XBROWSE oBrw SIZE 900,-20 PIXEL OF oDlg ;
DATASOURCE "MASTER" ;
COLUMNS aFields;
headers aHeaders;
colsize aSizes;
AUTOSORT ;
LINES NOBORDER