21. 4GL Statement Glossary : Inquire_forms : Inquire_forms Field
 
Share this page                  
Inquire_forms Field
inquire_forms field formname 
   (fieldname = inquire_forms_constant [(fieldname)] 
   {, fieldname = inquire_forms_constant
   
[(fieldname)]})
This statement returns runtime information about a particular field. The fieldname following the inquire_forms_constant is the frsobject for this type of inquiry.
If formname is a null string and no fieldname appears after the FRS constant (inquire_forms_constant), the FRS constant refers to the current field on the current form.
Legal FRS constants for the inquire_forms_constant are described as follows. They apply to simple fields and table fields except as noted for invisible and change, which can be used with simple fields only.
exists
Specifies an integer indicating whether the field exists or not. Returns 1 if the field exists; otherwise, returns 0.
name
Specifies a character string containing the name of the current field. Do not add a fieldname.
number
Specifies an integer value containing the sequence number of the field within the form, specified during design of the form with VIFRED.
length
Specifies the length of the data window in bytes (an integer value). If the field is a table field, the value of length is 0.
inputmasking
Specifies an integer value indicating whether an input mask is in effect for the field. Returns 1 if inputmasking is on, 0 if inputmasking is off.
datatype
Specifies n integer value representing the data type of the field:
integer=30
float=31
c=32
vchar=37
date=3
money=5
char=20
varchar=21
decimal=10
Nullable datatypes are returned as the negative value of their non-nullable counterparts. For example, a nullable integer datatype returns -30. Note that the datatype constant supersedes type.
derivation_string
Specifies a character string containing the derivation string for a derived field. Returns an empty string if the column is not derived.
derived
Specifies an integer value used to determine whether a field is derived. Returns 1 if the field is derived; otherwise, it returns 0.
format
Specifies a character string containing the format string specified for the field. If the field is a table field, the value is an empty string.
valid
Specifies a character string containing the validity check specified for the field (empty for a table field)
table
Specifies an integer value indicating field type; set to 1 for a table field; otherwise, 0
reverse, blink, underline, intensity, displayonly, invisible, normal
Integer values specifying whether the display attribute is on (1) or off (0).
These are set using the ABF FormEdit operation to access VIFRED.
color
Specifies an integer in the range from 0 to 7, indicating the color code for the field. The default color code is 0.
mode
Specifies a character string containing the display mode of the field. The possible values are update, fill, query, or read for table fields and fill, query, or read for simple fields.
change
Specifies an integer value indicating whether you have made any changes to the field. Available only for simple fields. The value for change is 1 or 0 as follows:
1
If you have made any changes to the field, change is set to 1.
The clearrest FRS command also sets change to 1. The clearrest command is mapped to the Return key on many terminals.
0
Change is set to 0:
At the start of a display loop
When the program places a value in the field
When the field is cleared via a clear field statement.
Some FRS constants do not apply to a table field as a whole but rather to individual columns or rows. For these, use the inquire_forms column and inquire_forms row statements.
Inquire_forms Form
inquire_forms form 
  (fieldname = inquire_forms_constant [(formname)] 
  {, fieldname = inquire_forms_constant
  [(formname)]}) 
This statement returns runtime information about aparticular form. The following table shows legal values (the inquire_forms_constant or FRS constant) for the inquire_forms form statement:
exists
Specifies an integer indicating whether the form exists or not. Returns 1 if the form exists; otherwise, returns 0.
name
Specifies a character string containing the name of the current form. Do not add a formname as an operand.
change
Specifies an integer value set to 1 if changes have been made to the data displayed on the form. Otherwise, it is 0. A clear field all statement does not reset this to 0 for the form.
mode
Specifies a character string containing the display mode of the form. Legal values: none, fill, update, read, query.
field
Specifies a character string containing the name of the field on which the cursor is currently positioned.
rows
Specifies an integer value indicating the number of rows in the form specified by formname. If the form is a pop-up, the number indicates the rows occupied by the form's borders. The formname must be the name of the form where the cursor currently rests.
columns
Specifies an integer indicating the number of columns in the form named by formname. For pop-up forms, indicates the columns occupied by the form's borders. The formname must be the name of the form the cursor currently occupies.
Inquire_forms Menu
inquire_forms menu formname
   (fieldname = inquire_forms_constant[(menuitem)]
   {, fieldname = inquire_forms_constant[(menuitem)]})
Use this statement to inquire about the status of a menu item.
inquire_forms_constant
Specifies a constant:
active
Specifies an integer indicating whether the menu item is enabled (1) or disabled (0)
Inquire_forms Row
inquire_forms row formname tablename [rownumber]
  (fieldname = inquire_forms_constant [(columnname)] 
  {, fieldname = inquire_forms_constant
    [(columnname)]})
To inquire about a particular displayed row, use an optional row number. The current row is the default. In an unloadtable statement loop, you can use inquiry only on the row just unloaded. If you specify a row number when using this statement with an unloadtable statement loop, you receive an error message.
If you do not specify a formname, tablename, rownumber, or columnname, then the constant refers to the current field within the table field in the form that the cursor currently occupies.
The following are legal values (the inquire_forms_constant or FRS constant) for inquire_forms row:
change
Specifies an integer value:
1
Indicates changes have been made to the data displayed in the column.
The clearrest FRS command also sets change to 1. The clearrest command is mapped to the Enter key on many PCs, and to the Return key on many terminals.
0
Indicates that change is set to 0:
At the start of a display loop
When the program places a value into the column
When the program clears the column
When a new row is created (as with an insertrow statement)
reverse, blink, underline, intensity
Integer values specifying whether the display attribute is on (1) or off (0).
These are set using the ABF FormEdit operation to access VIFRED.
color
Specifies an integer in the range from 0 to 7, indicating the color code for the field. The default color code is 0.
Inquire_forms Table
inquire_forms table formname 
  (fieldname = inquire_forms_constant
    [(tablefieldname)]
  {,fieldname = inquire_forms_constant
    [(tablefieldname)]})
This variant retrieves runtime information about a table. If you leave formname as a blank and do not specify a tablefieldname after the FRS constant, the FRS constant refers to the table field of the form in which the cursor currently rests. Information returned about a table field always is at the table level rather than at the field level.
The following are legal values (the inquire_forms_constant or FRS constant) for inquire_forms table:
name
Specifies a character string containing the name of the current table field. Do not add a tablefieldname.
rowno
Specifies an integer value indicating the current row number within the table field, where the first row is numbered 1
maxrow
Specifies an integer value containing the number of displayed rows for the table field as defined with VIFRED
lastrow
Specifies an integer containing the number of displayed rows in the table field that actually contain data
datarows
Specifies an integer indicating the number of nondeleted rows stored in the data set for the table field
maxcol
Specifies an integer indicating the number of displayed columns defined for the table field
column
Specifies a character string with the name of the column, which the cursor occupies
mode
Specifies a character string containing the table field's initialization mode. Its possible values are read, update, fill, or query.