1) Important: Please do not use FIELDS clause. This was originally meant to facilitate easy migration from WBrowse.
Using COLUMNS clause allows us to to take full power of XBrowse. Using FIELDS clause makes XBrowse dumb
2) If we want to specify all columns of the DBF, there is no need for our program to read the structure and specify the column names.
Use the clause AUTOCOLS instead of COLUMNS .... clause.
When we use AUTOCOLS clause, XBrowse itself reads the DBSTRUCT() and builds all the columns suitably, including the sort orders.
Example:
- Code: Select all Expand view
[code]@ r,c XBROWSE oBrw SIZE w,h PIXEL OF oDlg ;
DATASOURCE "aliasname" AUTOCOLS[/code] ;
<otherClauses>
Still just for academic interest, just to know how to generate column names from DBSTRUCT():
- Code: Select all Expand view
@ r,c XBROWSE oBrw SIZE w,h PIXEL OF oDlg ;
DATASOURCE "CUSTOMER" ;
COLUMNS ArrTranspose( CUSTOMER->(DBSTRUCT()))[ 1 ] ....
though we do not recommend this because this is totally unnecessary