FWH 1805: XBrowse New syntax
Posted: Sun Jul 08, 2018 4:18 am
An alternative syntax is now availabe for defining columns while creating XBrowse.
The syntax is explained with examples.
The syntax is explained with examples.
Code: Select all
#include "fivewin.ch"
function Main()
local oDlg, oBrw, aData
USE CUSTOMER NEW
DEFINE DIALOG oDlg SIZE 560,400 PIXEL TRUEPIXEL TITLE "NEW SYNTAX" RESIZABLE
@ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
DATASOURCE Alias() COLUMNS ;
"TRIM(FIRST)+', '+TRIM(LAST) AS FullName PICTURE @! WIDTH 150 ALIGN CENTER SORT FIRST", ;
"TRIM(STREET)+', '+TRIM(CITY) AS Address WIDTH 250 SORT CITY", ;
"AGE PICT 999" ;
CELL LINES NOBORDER AUTOSORT
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTERED NOMODAL
GO TOP
aData := FW_DbfToArray( "FIRST,CITY" )
XBROWSER aData COLUMNS "1 AS FirstName", "2 AS City"
CLOSE CUSTOMER
return nil