Was this helpful?
Retrieving Information about the Runtime System
The frs object name is used to retrieve information about the FRS. The syntax of this statement is:
inquire_frs frs
    (variable = frs_constant[(frs_object)]
    {, variable = frs_constant[(frs_object)]})
The following table lists the accepted frs_constants, their associated frs_objects, and the data type of the returned value:
Frs_constant
Data Type
Returns
activate
integer
Returns 1 if the type of field activation specified by its frs_object is turned on; otherwise, it returns 0. Valid frs_objects are:
before: Returns 1 if field entry activation is enabled.
nextfield: Returns 1 if field exit activation is enabled when the user moves forward out of a field. If an exit activation is defined for a field, the activation occurs when the user moves forward out of the field. You must use the set_frs statement to enable activations arising from a backward exit.
previousfield: Returns 1 if field activation occurs when the user moves backward to the previous field on a form.
menu: Returns 1 if field activation occurs when the user presses the Menu key.
keys: Returns 1 if field activation occurs when the user presses a function, arrow, or control key associated with an FRS key.
menuitem: Returns 1 if field activation occurs when the user selects a menu item (or a function, arrow, or control key mapped to a menu item).
You can use the set_frs statement to turn on and off the activations for the activities represented by the frs_object.
A field activation only takes place under the above conditions if an activate field statement has been specified for the field where the cursor is resting or entering.
columns
integer
Returns the size of the terminal screen, in terms of the number of columns. Omit frs_object.
command
integer
Returns an integer representing the last FRS command entered by the user. An application can use this information inside an activation block when it needs to know exactly which command caused an activation to occur.
Omit frs_object.
Returned integer values and their meanings are:
 
 
Value FRS Command
0 Undefined
1 menu key
2 any FRS key
3 any menu item
4 next field or autoduplicate previousfield
5 downline
6 upline
7 newrow
8 clearrest
9 scrollup
10 scrolldown
11 nextitem or auto tab
12 timeout
13 new field selected by mouse
14
 
 
Undefined (0) is returned in two instances:
If an inquire is executed after exiting from a submenu block and before reentering the display loop,
If the return from a prompt or message was not caused by a timeout.
cursorcolumn
integer
Returns the current column position of the cursor. Omit frs_object.
cursorrow
integer
Returns the current row position of the cursor. Omit frs_object.
editor
integer
Returns 1 if the FRS editor command is enabled; 0 if it is not. Editor does not accept an frs_object.
errorno
integer
Returns the FRS error number; set if an error occurs when executing a forms statement in the current display loop. Errorno does not accept an frs_object.
Errortext
character
Returns the text of error message associated with the error number returned by errorno. Returns an empty string if there is no current error. Errortext does not accept an frs_object.
getmessages
integer
Returns 1 if the error messages associated with the getform, getrow, and unloadtable statements are suppressed. If they are not, this returns 0. Does not take an frs_object.
label
character
Returns the alias given to the control, function, or arrow key to which the specified frs_object is mapped.
If an alias is defined for a control key, arrow key, or function key, the alias is displayed rather than the key's name in the help facility display and on the menu line for menu items that are mapped to that key. Aliases are very useful for determining which key to press to execute a desired function. By using the letters on a terminal key cap as aliases for function keys, you can make it easier for the user to select the correct key.
You can define an alias in the mapping file or using the set_frs statement. See the Character-based Querying and Reporting Tools User Guide for details on the mapping file.
The following are valid frs_objects:
menuN: Returns the alias for the key to which the Nth menu item on the menu line is mapped. N must be in the range of 1 to 25, inclusive.
frs_command: Returns the alias for the key to which the specified frs_command is mapped. FRS commands are listed in Character-based Querying and Reporting Tools User Guide.
frskeyN: Returns the alias for the key to which the Nth frskey is mapped. N must be in the range of 1 to 40, inclusive.
Inquire_frs returns a null string if the specified frs_object is not mapped to a control, function, or arrow key. If the object is mapped to a key but no alias has been defined for that key, then inquire_frs returns the name of the key. Control keys are returned as Control X where X can be any one of the characters A-Z or Esc or Del. Function keys are returned as PFN where N is a number from 1 to 40.
last_frskey
integer
Returns the number of the FRS key selected by the user. The numbers returned start at 1. If the activation was not the result of an FRS key selection, returns a -1.
Useful when two or more FRS keys are combined in a single activation block and the program must know which key was actually selected. Last_frskey does not take an frs_object.
Map
character
Returns the name of the control, functions, or arrow key to which the specified frs_object is mapped. Returns a null string if there is no key mapped to the object. (See Character-based Querying and Reporting Tools User Guide for information about key mapping.)
The following are valid frs_objects:
menuN: Returns the key to which the Nth menu item on the menu line is mapped. N must be in the range of 1 to 25, inclusive.
frs_command: Returns the key to which the specified frs_command is mapped. FRS commands are listed in Character-based Querying and Reporting Tools User Guide.
frskeyN: Returns the key to which the Nth frskey is mapped. N must be in the range of 1 to 40, inclusive.
mapfile
character
Returns the file specification for the application's FRS key mapping file. Mapfile does not accept an frs_object.
menumap
integer
Returns 1 if the menu line currently displays association between menu items and function, control, or arrow keys, or 0 otherwise. Menumap does not accept an frs_object.
outofdatamessage
integer
Returns 0 if the Out of Data message is suppressed, 1 if the message is displayed, or 2 if the FRS sounds the terminal bell when the user attempts to scroll off the top or bottom of a table field.
rows
integer
Returns the size of the terminal screen, in terms of the number of rows. Omit frs_object.
shell
integer
Returns 1 if the FRS shell command is enabled; 0 if it is not. Shell does not accept an frs_object.
terminal
character
Returns the type of terminal, such as vt100.Terminal does not accept an frs_object.
timeout
integer
Returns the number of seconds specified to wait before a timeout occurs. Timeout does not use an frs_object.
validate
integer
Returns a 1 if the type of field validation specified by its frs_object is turned on; otherwise, it returns 0. Valid frsobjects are:
nextfield—Returns 1 if field validation occurs when the user moves forward to the next field on a form.
previousfield—Returns 1 if field validation occurs when the user moves backward to the previous field on a form.
menu—Returns 1 if field validation occurs when the user presses the Menu key.
keys—Returns 1 if field validation occurs when the user presses a function, arrow, or control key associated with an FRS key.
menuitem—Returns 1 if field validation occurs when the user selects a menu item (or a function, arrow, or control key mapped to a menu item).
You can use the set_frs statement to turn on and off the validations for the activities represented by the frs_objects.
Last modified date: 08/28/2024