GET_FLDBUF() [function]
The GET_FLDBUF() operator returns as
character strings the current values of the specified fields.
Syntax
GET_FLDBUF ( [group.]field [,...] )
- group can be a table name, a screen record, a screen array
or
FORMONLYas defined in the form. - field is the name of the field as defined in the form.
Usage
The GET_FLDBUF() operator is used to get the value of a screen field before the
input buffer is copied into the associated variable.
Use of the GET_FLDBUF() operator is recommended only in dialogs allowing field
input (INPUT, INPUT ARRAY, CONSTRUCT). The
behavior is undefined when used in DISPLAY ARRAY.
The GET_FLDBUF() operator takes the field names as identifiers, not as string
expressions:
LET v = GET_FLDBUF( customer.custname )If multiple fields are specified between parentheses, use the RETURNING
clause:
CALL GET_FLDBUF( customer.* ) RETURNING rec_customer.*When used in a INPUT ARRAY instruction, the runtime system assumes that you are
referring to the current row.
The values returned by this operator are context dependent; it must be used carefully. If possible, use the variable associated to the input field instead.
When using the UNBUFFERED mode, program variables are automatically assigned,
and the GET_FLDBUF() operator is not required in most cases.
Without group prefix, the operator will try to find a matching field name, by
ignoring the prefix used in the form file or in the FROM clause of the dialog
instruction. Inside a DIALOG block, if several sub-dialogs use the same field name,
the operator will use the field in the current sub-dialog.
FORMONLY keyword as defined in the form file. The group
prefix to be specified depends on the type of variable-to-field binding used by the dialog instruction:- When using the
BY NAMEclause as inINPUT var-list BY NAMEorCONTRUCT BY NAME sql-cond ON column-list, the field prefix must match the table name specified in the form definition file. If no field is found, a second search is done by ignoring the prefix and takes the first field of the form with this name. - When using the
FROMclause as inINPUT var-list FROM field-list,CONTRUCT sql-cond ON column-list FROM field-listorINPUT ARRAY arr-name FROM scr-array.*, the field prefix must match the table name, screen record or screen array used in theFROMclause.
Example
INPUT BY NAME ...
...
ON KEY(CONTROL-Z)
LET v = GET_FLDBUF( customer.custname )
IF check_synonyms(v) THEN
...