17. Forms Statements : inquire_frs Statement—Retrieve FRS Runtime Information : Retrieving Information about a Field
 
Share this page                  
Retrieving Information about a Field
The field object type retrieves information about a field in a form. The syntax is:
inquire_frs field formname
     (variable = frs_constant[(fieldname)]
     {,variable = frs_constant[(fieldname)]})
Formname identifies the form that contains the specified field. If formname is left as an empty or blank string and no fieldname is specified after the constant, then the constant references the current field of the current form. This format is particularly useful in a form display loop or the formdata loop. You can express both formname and fieldname as quoted or unquoted string literals or program variables.
The fieldname can identify either simple fields or table fields; some inquiries (for example, datatype) are meaningless when applied to tablefields as a whole. To retrieve information about a table field or its columns, see Retrieving Information about a Table Field and Retrieving Information about a Column.
Valid values for frs_constant are listed in the following table:
Frs_constant
Data Type
Returns
change
integer
Returns1 if the user has typed into the field, 0 otherwise. A corresponding set_frs statement is available to set the change variable for the field. A field's change variable is set to 1 whenever a runtime user types into the field. The clearrest FRS command, mapped to the Return key on many terminals, sets this constant. It is set to 0 at the start of a display loop, when a value is placed into the field by a putform statement or when the field is cleared by a clear statement. You cannot specify a table field when you use this constant.
color
integer
Returns the color code
(0-7) for the field. The default color is 0.
columns
integer
Returns the number of columns occupied by the current simple field input area. Formname must be a quoted empty or blank string, and fieldname is not specified.
datatype
integer
Returns the true data type of field:
 
date
money
decimal
char
varchar
integer
float
c
text
3
5
10
20
21
30
31
32
37
 
 
Nullable data types are returned as the negative value of the non-nullable ones.
For example, a nullable integer data type returns -30.
derived
integer
Returns a 1 if the field is a derived field or 0 if it is not.
derivation_string
character
Returns the derivation string of the field. If the field is not a derived field, this returns an empty string.
display
integer
Returns a 1 if the attribute specified by display is in effect for the field or 0 if it is not. Display can be any of the following constants:
reverse
blink
underline
intensity
normal
displayonly
invisible
Exception: normal returns 1 if no attributes are in effect for the field or 0 if any attribute is in effect; the settings of the displayonly and invisible attributes do not affect the value returned for the normal constant.
To set display attributes, use the set_frs statement.
exists
integer
Returns 1 if the specified field exists, 0 if the field does not exist. Valid for simple fields and table fields.
format
character
Returns the format string specified for field.
inputmasking
integer
Returns 1 if inputmasking is in effect, 0 if it is not.
length
integer
Returns the length, in bytes, of the data area in the field.
mode
character
Returns the field's display mode as specified: fill, update (table field only), query or read. The specified field can be either a simple field or a table field.
name
character
Returns the name of the field. Because this constant always refers to the current field, it is not necessary to specify a fieldname.
number
integer
Returns the sequence number within the form for the field (sequence numbers start at 1). (If your form was created using Ingres 6.3 or an earlier release of Ingres, then display-only fields return a negative number.)
rows
integer
Returns the number of rows occupied by the current simple field input area. Formname must be a quoted empty or blank string, and fieldname is not specified.
startcolumn
integer
Returns the column position of the upper left hand corner of the current simple field input area. This constant does not allow the use of an explicit fieldname, and formname must be a quoted empty or blank string. The returned values are relative to the terminal screen, whose origin point is its upper left hand corner, described as row 1, column 1. If the value returned is zero or negative, then the upper left hand corner of the field is not visible on the screen.
startrow
integer
Returns the row position of the upper left hand corner of the current simple field input area. This constant does not allow the use of an explicit fieldname, and formname must be a quoted empty or blank string. The returned values are relative to the terminal screen, whose origin point is its upper left hand corner, described as row 1, column 1. If the value returned is zero or negative, then the upper left hand corner of the field is not visible on the screen.
table
integer
Returns 1 if this field is a table field, or 0 if it is a regular field.
type
integer
Returns the basic data type of field (1=integer, 2=float, money or decimal, 3=varchar or char or c or text or date).
valid
character
Returns the validation string for field.