The fgl_formfield_getoption() function allows you to retrieve information about the current field, during a dialog function:
fgl_formfield_getoption(option)
Where option is a CHAR(n) datatype variable which can be any one of the following:
x The column position within the screen
y The line position within the screen
length The length, in character spaces, of the field
In the example below, information window with the results
of the fgl_formfield_getoption()
function execution will appear after changing the focus (between the input
fields) and pressing the ACCEPT
button.
MAIN
DEFINE rec_1 RECORD
f1 CHAR(10),
f2 CHAR(10),
f3 CHAR(10),
f4 CHAR(10)
END RECORD
DEFINE field_info SMALLINT
DEFINE print_string CHAR(256)
OPEN WINDOW win AT 3,1 with FORM "fgl_formfield_getoption_function"
INPUT by name rec_1.* WITHOUT DEFAULTS
ON ACTION ACCEPT
LET field_info = fgl_formfield_getoption("x")
LET print_string = "fgl_formfield_getoption(\"x\") returned:", field_info
LET field_info = fgl_formfield_getoption("y")
LET print_string = print_string clipped, "\nfgl_formfield_getoption(\"y\") returned:", field_info
LET field_info = fgl_formfield_getoption("length")
LET print_string = print_string clipped, "\nfgl_formfield_getoption(\"lenght\") returned:", field_info
CALL fgl_winmessage("fgl_formfield_getoption", print_string, "info")
END INPUT
END MAIN
example form code
DATABASE FORMONLY
SCREEN
{
f1:[f1 ]f2:[f2 ]
f3:[f3 ]f4:[f4 ]
}
ATTRIBUTES
f1=FORMONLY.f1;
f2=FORMONLY.f2;
f3=FORMONLY.f3;
f4=FORMONLY.f4;
INSTRUCTIONS
SCREEN RECORD s_rec (
FORMONLY.f1,
FORMONLY.f2,
FORMONLY.f3,
FORMONLY.f4
)
DELIMITERS "[]"