Command APPFIELD Foundation
Specifies a database field to be displayed in an Application Part.
APPFIELD <cFieldName> | <memvar> := <expression> ;
[ INTO <oApp> ] ;
[ TYPE <cType> ] ;
[ LEN <nLen> ] ;
[ DEC <nDec> ] ;
[ FONT <cFontCompoundName> ] ;
[ COLOR <nForeGround1> [, <nBackGround1>] ] ;
[ HILITE <nForeGround2> [, <nBackGround2>] ] ;
[ ALIGN LEFT | CENTER | RIGHT ] ;
[ WIDTH <nWidth> ] ;
[ READONLY ] ;
[ HEADING | CAPTION <cHeading> ;
[ FONT <cFontCompoundName> ] ;
[ COLOR <nForeGround> [, <nBackGround>] ] ;
[ ALIGN LEFT | CENTER | RIGHT> ] ;
] ;
[ FOOTING | COMMENT <cFooting> ;
[ FONT <cFontCompoundName> ] ;
[ COLOR <nForeGround> [, <nBackGround>] ] ;
[ ALIGN LEFT | CENTER | RIGHT ] ;
The APPFIELD command is used to configure the display of single fields in Application Parts in greater detail, compared to the available options of the APPEDIT or APPBROWSE command. In addition, APPFIELD allows to define an expression, rather than a field, whose result is displayed in an Application Part. This is coded as an assignment, where the inline assignment operator must be used to assign the result of an expression to a memory variable.
The APPFIELD command can only be used after a command that creates an Application part. For example, the command APPEDIT or APPBROWSE must be executed in a program before APPFIELD may be used. When an Application Part is displayed with APPDISPLAY, the APPFIELD command must not be used until the next Application Part is created.
// The APPFIELD command is executed in the example between
// APPEDIT and APPDISPLAY. This defines fields for APPEDIT
// without using the APPEDIT...FIELDS option. The first field
// displays an expression (current record pointer position).
// This field cannot be edited.
#include "Appedit.ch"
#include "Gra.ch"
MEMVAR appObject
PROCEDURE AppSys
// Desktop remains application window
RETURN
PROCEDURE Main
LOCAL nVar
USE Customer // Open database
APPEDIT STYLE FANCY ; // Define edit dialog
POSITION CENTER ;
HEADING "Customer Address" ;
COLOR GRA_CLR_CYAN, GRA_CLR_BLUE ;
FONT "24.Helvetica" ;
CAPTION COLOR GRA_CLR_BLUE ALIGN RIGHT
// Define expression
APPFIELD nVar := Recno() CAPTION "Record number"
// Define fields
APPFIELD FIRSTNAME COLOR GRA_CLR_RED
APPFIELD LASTNAME COLOR GRA_CLR_YELLOW, GRA_CLR_BLUE
APPFIELD STREET COMMENT "This is field 'STREET '"
APPFIELD CITY COMMENT "This is field 'CITY '"
APPFIELD ZIP COMMENT "This is field 'ZIP '"
APPFIELD NOTES COMMENT "This is field 'NOTES '"
APPDISPLAY // Display AppEdit window modal
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.