The fgl_dialog_setbuffer() function takes a value or variable as its argument. That variable is the value to be set in the current field.
The function can also be written as dialog.setbuffer(), the result is the same.
This function has no return value.
This function takes no effect in the BEFORE FIELD trigger.
If this function is used in an INPUT statement, it modifies the input buffer for the current field; however, its input variable is only assigned on leaving the field.
It marks the flags for the current field and the dialog as ‘touched’. If this function is called, both FIELD_TOUCHED() and FGL_BUFFERTOUCHED() will return TRUE.
In the example below, buffer value will be assigned to field after clicking the input field in the form and pressing the ACCEPT button.
MAIN
DEFINE
rec1 RECORD
f1 char(20),
f2 char(20)
end record
OPEN WINDOW w1 WITH FORM "fgl_dialog_setbuffer_function"
INPUT BY NAME rec1.* WITHOUT DEFAULTS
ON KEY (ACCEPT)
IF INFIELD(F1) THEN
CALL fgl_dialog_setbuffer("123456789")
END IF
IF INFIELD(F2) THEN
CALL fgl_dialog_setbuffer("987654321")
END IF
END INPUT
CLOSE WINDOW w1
END MAIN
example form code
DATABASE FORMONLY
SCREEN
{
[f1 ]
[f2 ]
}
ATTRIBUTES
f1=FORMONLY.f1;
f2=FORMONLY.f2;
INSTRUCTIONS
SCREEN RECORD s_rec (
FORMONLY.f1,
FORMONLY.f2
)
DELIMITERS "[]"