Key Code List | Syntax of Import/Export Files |
This chapter provides detailed descriptions of the functions that you can include in a global or local dialog (see the chapter Dialog for details).
Each function can have up to three parameters, which can be one of the following types:
attr | One of the following run-time
attribute names: AUX1 AUX2 AUX3 AUX4 ERROR INPUT NATIVE These enable you to associate foreground/background colors with panel fields when the screenset runs. |
|
group | The name of a group field. | |
proc | The name of a dialog procedure, Pnnn, where nnn is a procedure number in the range 000 to 255. In functions that require a procedure parameter, you can supply the procedure number in a field or register. | |
numeric | A numeric literal. | |
string | An alphanumeric literal surrounded by quotes ("). If the first character of a parameter is a quote ("), it is assumed to be an alphanumeric literal. You can enter a literal of up to 80 characters by scrolling the field horizontally. | |
field | The name of a data field. If
the field is a group field, the field name can have a subscript that
identifies a particular occurrence of the group:
field(subscript) subscript can be a numeric literal, a register, or the name of another field (which must not be group field). |
|
panel | The name of a panel in a screenset. | |
register | Dialog System maintains a number of internal registers. All registers are two-byte computational fields. The following register is provided: | |
$REG | A general purpose register. Functions can read from $REG or write to it. | |
null | You use the value $NULL to indicate that you are not supplying a parameter value for an optional parameter (for example, the optional procedure name parameter of the PUSH function). |
This section contains a description of each function and its parameters.
Where a parameter is described as field(sub), the parameter can be a subscripted or non-subscripted field name.
BEEP sounds the beep on the machine.
BEEP
None |
BP branches to a procedure without executing the remaining functions in the dialog line.
BP procedure
procedure |
proc, field(sub), or register.
The procedure to be branched to. |
BP P063
Branches to procedure 063.
MOVE 75 $REG BP $REG
Branches to procedure 075.
BPD branches to a procedure without executing the remaining functions in the dialog line.
The destination procedure number is n+m-1, where:
BPD group procedure
group |
The name of the group on which to act. |
procedure |
proc, field(sub), or register.
The procedure to branch to if the selection bar in group is at position one. |
BPD MYGROUP 65
If the selection bar in MYGROUP is in position one, control branches to procedure 065; if it is in position four, control branches to procedure 068.
BPE branches to a procedure only if the next function in the dialog line causes an exception condition. The remaining functions in the dialog line are not executed.
BPE procedure
procedure |
proc or field(sub).
The exception procedure to be branched to. |
A function that can cause an exception has an entry in its description describing the conditions under which it can cause an exception.
BPE P045 POP
Branches to procedure 045 only if the POP function causes an exception by attempting to pop an empty stack.
BPR branches to a procedure without executing the remaining functions in the dialog line.
The destination procedure number is n+m-1, where:
BPR procedure
procedure |
proc, field(sub), or
register.
The procedure to which control branches if the value in the register is 1. |
MOVE 4 $REG BPR 65
Branches to procedure 068.
Use CALLOUT to make a synchronous call to an external program, so that you can call a user program directly from dialog.
CALLOUT program-name callout-type callout-parameter
program-name |
string
The name of the program being called. |
callout-type |
numeric
Must be 0000 or 0006. When the value 0006 is specified, the content of RETURN-CODE on exiting the callout program is moved into $REG, unless the value is -9999, when $REG is unaffected, but the dialog exception condition is set. RETURN-CODE is always cleared to zero. |
callout-parameter |
Must be $NULL. Specifies that the whole of the Data Block is passed. |
The normal search paths for COBOL programs are used.
The first parameter passed by Dialog System to the called program is the Ds-Control-Block, described in either ds-cntrl.mf or ds-cntrl.ans in the chapter Running the Screenset. You cannot make any changes to this control block; any changes you attempt will not be reflected in Dialog System's copy of the control block.
The second parameter passed by Dialog System to the called program is the screenset-Data-Block. The callout program can modify the Data Block as desired. You can use the screenset copybook that is generated by Dialog System to define the Data Block in the main application, as the data definition of the Data Block in the callout program.
The CALLOUT function has the following restrictions:
The function causes an exception condition (see BPE) if the program specified is not found.
CALLOUT "\usr\abc\user-program" 0000 $NULL
Executes the program user-program.
CEOF clears a field from the current cursor position to the end of the field and fills it with spaces. The field must be alphanumeric or alphabetic, otherwise this function has no effect.
CEOF
None
CFLD clears all of an input field. The field is filled with spaces if it is an alphanumeric or alphabetic field, or zeros if it is a numeric field.
CFLD field
field |
field(sub).
The name of the field. If this parameter is NULL, the current field is cleared. |
CLEAR clears all of the fields on the current panel.
CLEAR
None
CLRF sets the value of a field to false (0).
CLRF field
field |
field(sub).
The name of the field. |
CLRF MYGROUP(10)
Sets the tenth field in group MYGROUP to zero.
COFF turns the cursor state to off. The cursor is invisible if the current panel has no input fields.
COFF
None
This function is system dependent, so it might not work on your system.
CON turns the cursor state to on. The cursor is present even if there are no input fields on the current panel.
CON
None
This function is system dependent, so it might not work on your system.
DPB deletes the line at the current selection bar position.
DBP group
group |
The name of the group on which to act. |
The size of the group's internal array is decremented by one. Data in lines beyond the deleted line is shifted down one position.
When the internal array size is one, the DBP function does not work. The first occurrence is cleared, but the array size remains at one, because you cannot have a group that contains zero occurrences.
The group MYGROUP contains the following values (the values between the lines represent the fields visible on the panel, and the asterisks represent the position of the selection bar):
12 20 -------------------- 35 4*************** 65 -------------------- 19 25
The function:
DBP MYGROUP
alters MYGROUP as follows:
12 20 -------------------- 35 65*************** 19 -------------------- 25
DECVAL decrements a numeric field or register by one.
DECVAL item
item |
field(sub) or register ($REG only).
The name of the item to be decremented. |
DECVAL $REG DECVAL QUANTITY(3)
The first example decrements the value of $REG; the second example decrements the third occurrence in group field QUANTITY.
GOF transfers control to a specified field in the current panel. If the field is not on the current panel, each panel in the screenset is searched until a panel containing the specified field is found.
GOF field
field |
field(sub) or register.
The name of the field to which control is transferred. |
You can pass a field number in a register. Remember that this is the number of the field in the Data Block, rather than the number of the field in the panel.
The function causes an exception when the specified field cannot be found in any panel in the screenset.
GOF DESCR GOF PRICE($REG) GOF $REG
The first example transfers control to the field named DESCR. The second example transfers control to an occurrence in the group field PRICE; the occurrence is determined by the current value of $REG. The final example transfers control to field number n, where n is the value of $REG; note that this is the nth field in the Data Block, not the nth field in the panel.
GOMOUSE enables mouse support, without you having to return to the application or execute a CALLOUT.
GOMOUSE number
number |
numeric.
A number that represents the following settings:
|
These settings exhibit cumulative behavior. All relocations are to the position of the mouse cursor when a mouse button was last clicked.
MSL GOMOUSE 0007
Enables all of these actions for a panel.
GOP passes control to a specified panel.
GOP panel
panel |
The name of the panel to which control passes. |
Because this function passes control to another panel, you cannot define any subsequent entries in that dialog line.
The target panel must exist before you can use this function in dialog.
GOP NEXTPNL
Passes control to the panel named NEXTPNL.
IBP inserts an empty line into a group at the position of the selection bar.
IBP group
group |
The name of the group on which to act. |
The group's internal array size is incremented by one, subject to the maximum size of the Data Block. Data in lines after the inserted line is moved up by one position. The empty line contains zeros in numeric fields, and spaces elsewhere.
The function causes an exception when it attempts to insert a line into a group that is already full, because this would cause loss of data from the last item in the data group.
The field MYGROUP contains the following values (values between the lines are those values that are visible in the panel, and the asterisks show the position of the selection bar):
24 -------------------- 28 36************** 23 -------------------- 2 30
The function:
IBP MYGROUP
alters MYGROUP as follows:
24 -------------------- 28 *************** 36 -------------------- 23 2 30
IF tests an expression for validity, and if true, branches to a specified procedure where processing continues. Control does not return to the calling procedure. If the expression is false, execution continues at the line below the IF function.
The following IF functions are available:
IF <, IF <=, IF =, IF >, IF >=, IFNOT=
IF-statement expression1 expression2 procedure
IF-statement |
One of the above IF statements. |
expression1 |
numeric, string, field(sub), or register.
The first operand of the test. |
expression2 |
numeric, string, field(sub), or register.
The second operand of the test. |
procedure |
proc, field(sub), or register.
The procedure to branch to if the test is true. |
Expression1
and expression2
must be compatible types. For example, an expression cannot test a numeric
literal against an alphanumeric literal. A similar set of conditional
functions are provided that perform the target procedure and return
control to the calling procedure. See the XIF function later in this
chapter.
IF= QUANTITY 3 P045
Branches to procedure 045 if the field QUANTITY has the value 3.
IF> MYGROUP(2) $REG TARGET
Branches to the procedure whose number is stored in field TARGET if the second occurrence in group field MYGROUP is greater than the value in the register.
INCVAL increments a numeric field or register by one.
INCVAL item
item |
field(sub) or register ($REG only).
The item to be incremented. |
INCVAL $REG INCVAL STEP
The first example increments the register; the second example increments the field STEP.
KS scans the keyboard, checks the status of all the status keys, and forces any status key dialog to execute.
KS number
The Ins, Caps, Num (DOS only), and Scroll Lock status keys are tested for their toggle status. For example, the status of the Ins key after it is pressed five times is the same as after it is pressed just once.
However, the Alt, Ctrl, Left Shift and Right Shift keys are tested to determine whether or not they are currently being held down.
If your keyboard does not have the status keys described in this section, please consult your Release Notes to see which keys on the standard keyboard for your system provide the equivalent functions.
KS 55H
Checks the status of the Caps, Scroll Lock, Ctrl and Right Shift keys and activates any dialog associated with them.
MAS moves the defined internal array size of a group to a specified field or to the register.
MAS group destination
group |
The name of the group on which to act. |
destination |
field(sub) or register.
The location where the array size is stored. |
MAS MYGROUP $REG
Moves the internal array size of group MYGROUP to the register.
MB returns the value of the item at the selection bar in a group to a specified field or register.
MB group destination
group |
The name of the group on which to act. |
destination |
field(sub) or register ($REG only).
The location where the value of the item at the selection bar position is stored. |
The group MYGROUP contains the following values (values between the lines are visible in the panel, and asterisks mark the position of the selection bar):
SMITH JONES -------------------- ADAMS KNIGHT************** SNOW STEWART -------------------- MADISON
The function:
MB MYGROUP NAME
stores the value "KNIGHT" in field NAME.
MBD returns the data position where the selection bar is currently located to a specified field or register.
MBD group destination
group |
The name of the group on which to act. |
destination |
field(sub) or register ($REG only).
The location where the bar position is stored. |
The group MYGROUP contains the following values and the selection bar is at the fourth data item in the group (values between the lines are visible in the panel, and asterisks mark the position of the selection bar):
SMITH JONES -------------------- ADAMS KNIGHT************** SNOW STEWART -------------------- MADISON
The function:
MBD MYGROUP INDEX
stores the value 4 in the field INDEX.
MOVE places a value in a field or register.
MOVE source destination
source |
numeric, string, field(sub), or register.
The source of the move. |
destination |
field(sub) or register ($REG only).
The target of the move. |
Source
and Destination
must
be compatible types. For example, you cannot move an anlphanumeric source
to a numeric destination. If you move values between fields of different
lengths, the value is truncated, as necessary.
MOVE 3 $REG MOVE "INVALID PARAMETER" MSGFLD MOVE MYGROUP(INDEX) TEMP
The first example moves the value 3 into the register. The second example moves the string "INVALID PARAMETER" into the field MSGFLD. The third example moves the occurrence in MYGROUP given by INDEX into the field TEMP.
MOVEPNL moves a panel around the screen in any direction for any distance.
MOVEPNL panel direction distance
panel |
The name of the panel to move. If you specify a null parameter, the current active panel is moved. | ||||||||||
direction |
numeric, field(sub), or register.
The direction in which to move the panel, indicated by the following numbers:
|
||||||||||
distance |
numeric, field(sub), or register.
The distance, in characters, to move the panel. |
MOVEPNL PANEL1 2 20 MOVEPNL PANEL1 4 10
Moves PANEL1 20 characters right and 10 characters down.
MOVETXT transfers an occurrence of a virtual text group to an alphanumeric or alphabetic field.
MOVETXT group occurrence destination
group |
The name of the virtual text group. |
occurrence |
numeric, field(sub), or register.
The group occurrence number. |
destination |
field(sub) (must be an alphanumeric field).
The target of the move. |
MOVETXT VGROUP 4 TXTFLD
Moves the contents of the fourth occurrence in virtual text group VGROUP to field TXTFLD.
MPID obtains the identification number of a panel.
MPID panel destination
panel |
The panel name. |
destination |
field(sub) or register ($REG only).
The location where the panel identification number is stored. |
The calling program uses the panel id for a screenset that uses Micro Focus Panels (see the chapter Using Dialog System for details on using Micro Focus Panels) in DOS environments.
This function is not supported in the UNIX environment.
MPID HELPPNL PANEL-ID
Stores the identification number of panel HELPPNL in the field PANEL-ID.
MTD returns the number of the data item at the top of a visible data list to a specified field or register.
MTD group destination
group |
The name of the group on which to act. |
destination |
field(sub) or register ($REG only).
The location where the data occurrence is stored. |
The group MYGROUP contains the following values and the third data item is at the top of the visible screen (the values between lines are visible in the screen panel, and asterisks mark the position of the selection bar):
25 34 20 -------------------- 0 10 28**************** 12 -------------------- 46 45
The function:
MTD MYGROUP $REG
stores the value 3 in the register.
PBDN moves the selection bar down a specified number of positions in a group.
PBDN group number
group |
The name of the group on which to act. |
number |
numeric, field(sub), or register.
The number of occurrences by which to move the bar down. |
If you move the selection bar down by more lines than are visible in the group, the group automatically scrolls down the data, as long as the move does not exceed the number of data items.
The function causes an exception when the bar is positioned on the last occurrence in the group.
The group MYGROUP contains the following values (the values between lines are visible in the screen panel, and asterisks mark the position of the selection bar):
10 -------------------- 23 80*************** 17 42 -------------------- 0 4
The function:
PBDN 2
has the following effect:
10 -------------------- 23 80 17 42*************** -------------------- 0 4
If this is followed by:
PBDN 1
the display becomes:
10 23 -------------------- 80 17 42 0*************** -------------------- 4
PBUP moves the selection bar up a specified number of positions in a group.
PBUP group number
group |
The name of the group on which to act. |
number |
numeric, field(sub), or register.
The number of occurrences by which to move the bar up. |
If you move the selection bar up more lines than are visible in the group, the group automatically scrolls up the data, as long as the move does not exceed the number of data items.
The function causes an exception when the bar is positioned on the first occurrence in the panel group.
The group MYGROUP contains the following values (the values between lines are visible in the screen panel, and asterisks mark the position of the selection bar):
25 10 -------------------- 23 80*************** 17 42 -------------------- 4
The function:
PBUP 2
alters the display as follows:
25 -------------------- 10*************** 23 80 17 -------------------- 42 4
PDDN scrolls down a data array by the amount specified, without moving the selection bar.
PDDN group number
group |
The name of the group on which to act. |
number |
numeric, field(sub), or register.
The amount by which to scroll down the data. |
The function causes an exception when it is not possible to position the data any further down on the panel.
The group MYGROUP contains the following values (the values between lines are visible in the screen panel, and asterisks show the position of the selection bar):
FIRST SECOND THIRD ---------------------- FOURTH FIFTH SIXTH*************** SEVENTH EIGHTH ---------------------- NINTH TENTH ELVENTH TWELFTH
The function:
PDDN MYGROUP 2
alters the display as follows:
FIRST SECOND THIRD FOURTH FIFTH --------------------- SIXTH SEVENTH EIGHTH*************** NINTH TENTH --------------------- ELVENTH TWELFTH
PDUP scrolls up a data array by the amount specified, without moving the selection bar.
PDUP group number
group |
The name of the group on which to act. |
number |
numeric, field(sub), or register.
The amount by which to scroll the data up. |
The function causes an exception when it is not possible to position the data any further up on the panel.
The group MYGROUP contains the following values (the values between lines are visible in the screen panel, and asterisks show the position of the selection bar):
FIRST SECOND THIRD --------------------- FOURTH FIFTH SIXTH*************** SEVENTH EIGHTH --------------------- NINTH
The function:
PDUP MYGROUP 2
alters the display as follows:
FIRST --------------------- SECOND THIRD FOURTH*************** FIFTH SIXTH --------------------- SEVENTH EIGHTH NINTH
POP pops the most recent physical screen image from the stack and return control to that panel. The panel is the one that was active at the time the PUSH function was executed.
POP
None
Because this function passes control to another panel, you cannot define any subsequent entries in the dialog line containing the POP.
You can initiate dialog in the panel that is popped from the stack by specifying a procedure in the PUSH function that pushed the panel onto the stack.
The function causes an exception when the stack is empty.
PUSH pushes the current physical screen image onto a stack and retains control in the current panel.
PUSH procedure
procedure | proc or null.
The name of the procedure to execute after the POP associated with this PUSH is performed. A null parameter means that no procedure is executed after the panel is popped from the stack. |
The function causes an exception when the push panel stack is full (that is, when it contains the maximum 16 entries).
PUSH P053
Pushes the current screen image onto the stack, and specifies that after it is popped from the stack, procedure 053 is executed.
RETC forces control to return to the calling program, where the program can perform some action such as accessing the data base or deriving some new data values.
RETC
None
The only other way to return to the calling program is to define an input field as an exit field (see the chapter Panel Fields).
RFT refreshes the text in the current panel.
RFT
None
This function is especially useful following the SUSP function, and ensures that all updates made during the suspend are actually displayed.
RFTD refreshes all fields and scroll bars from the Data Block. In other words, it updates the optimization rectangle that incorporates all fields and scroll bars in the current panel.
RFTD
None
RKEY redirects the keystroke to another panel.
RKEY panel
panel |
The name of the panel to which the keystroke should be redirected. |
The function causes an exception when the specified key has already been redirected, or the redirected key does not exist on the target screen.
The key in the original dialog line in the current panel is F10. The line:
RKEY PANEL2
in the dialog line passes control to the F10 dialog entry in PANEL2. After completion of the F10 entry in PANEL2, control returns to the current panel.
RPKY repeats the last keystroke upon completion of the current dialog line.
RPKY
None
You normally use this function when the key that is pressed requires some action in the current panel that needs a different panel, and the keystroke also needs to be carried forward to this new panel.
You should use this function with caution, because an infinite loop is created at run time if control remains in the current panel.
SAS sets the internal array size of a group, limiting the amount of scrolling that can take place to the value specified.
SAS group number
group |
The name of the group on which to act. |
number |
numeric, field(sub), or register.
The new value of the array size. |
The function causes an exception when it attempts to set an array size of zero.
SAS MYGROUP 20
You can only display the first 20 occurrences in group MYGROUP.
SB places the selection bar on a specified occurrence in the visible data list of a group.
SB group number
group |
The name of the group on which to act. |
number |
numeric, field(sub), or register.
The occurrence to position the selection bar on. |
If you specify a value larger than the number of occurrences on the panel, the bar is positioned on the last panel occurrence.
The function causes an exception when it attempts to set the bar on a line that is beyond the limit of the panel group.
The visible data list of group MYGROUP looks like this (asterisks show the position of the selection bar):
10*************** 12 0 25
The function:
SB MYGROUP 3
alters the display as follows:
10 12 0*************** 25
The function:
SB MYGROUP 7
alters the display as follows:
10 12 0 25***************
SBOD positions the selection bar on the data item specified, and if necessary, scrolls the data to make the relevant lines visible. This function potentially can affect both the selection bar and data positions.
SBOD group occurrence
group |
The name of the group on which to act. |
occurrence |
numeric, field(sub), or register.
The data occurrence on which to set the selection bar. |
The specified data item and selection bar do not necessarily appear at line one. For example, if the required data item is near the end of the list, it is positioned at the end of the visible list rather than on line one.
If, however, the required data item is already visible, the selection bar simply moves to the item without scrolling the group.
The function causes an exception when it attempts to set the bar either on data item zero, or outside the limit of the Data Block.
The group MYGROUP contains the following values (values between lines are visible on the screen panel, and asterisks show the position of the selection bar):
BRIDGE CANASTA -------------------- POKER WHIST************** BLACKJACK SOLITAIRE -------------------- RUMMY CRIBBAGE
The function:
SBOD MYGROUP 2
alters the display as follows:
BRIDGE -------------------- CANASTA************* POKER WHIST BLACKJACK -------------------- SOLITAIRE RUMMY CRIBBAGE
SD scrolls the panel area to position the specified data occurrence in a group at the top of the associated panel, leaving the position of the selection bar unaltered.
SD group occurrence
group |
The name of the group on which to act. |
occurrence |
numeric, field(sub), or register.
The data occurrence to be positioned at line one of the screen panel. |
The function causes an exception when it attempts to set the panel area either on data item zero, or outside the limit of the Data Block.
The group MYGROUP contains the following values (values between lines are visible in the screen panel, and asterisks show the position of the selection):
1 2 --------------- 3 4 5********** --------------- 6 7 8
The function:
SD MYGROUP 5
alters the display as follows:
1 2 3 4 --------------- 5 6 7********** --------------- 8
SETCUR positions the cursor in the next input field.
SETCUR position
position | numeric, field(sub), or register.
The position of the cursor in the field. |
The cursor is moved only when the field is used for input.
SETCUR 5
Positions the cursor at character position 5 in the next input field.
SETF sets the value of a field to true (1).
SETF item
item |
field(sub).
The name of the field. |
SETF FLAGS(3)
Sets the third occurrence of group field FLAGS to 1.
SFAT sets a run-time display attribute on a particular field on the current panel.
SFAT field attribute
field |
field(sub) or register.
The field on which to set the attribute. |
attribute |
attr.
The name of the run-time attribute to be used. You can use any one of the six active run-time attributes (AUX1 through AUX4, INPUT, and ERROR), or NATIVE, which resets the attribute to the colour defined by the screenset. See the section Attribute Palette in the chapter Panel Painting. |
The function causes an exception when it attempts to set the attribute either on a field that does not exist or on a group field.
SFAT FIELD2 AUX1
Sets the field FIELD2 to the run-time display attribute AUX1.
SGAT sets a run-time display attribute on all fields on the current panel.
SGAT attribute
attribute |
attr.
The run-time attribute to be used. You can use any one of the six active run-time attributes (AUX1 through AUX4, INPUT, and ERROR), or NATIVE, which resets the attribute to the colour defined by the screenset. See the section Attribute Palette in the chapter Panel Painting. |
SGAT AUX2
Sets all fields of the current panel to the run-time display attribute AUX2.
SHP displays a panel while retaining control in the current panel.
SHP panel
panel |
The name of the panel to show. |
SHP ERRORPNL
Displays the panel ERRORPNL, but retains control in the current panel.
SKNF moves the cursor to a subsequent input field on the current panel.
SKNF number
number |
numeric, field(sub), or register.
The number of fields to skip over. |
If you specify a value larger than the remaining number of input fields in the panel, the cursor skips to the last input field on the panel; SKNF 9999 is guaranteed to do this.
The function causes an exception when there is no subsequent input field.
SKNF 1
Skips to the next input field in the current panel.
SKPF moves the cursor to a previous input field on the current panel.
SKPF number
number |
numeric, field(sub), or register.
The number of fields to skip over. |
If you specify a value larger than the number of input fields before the
current field, the cursor skips to the first input field on the panel;
SKPF 9999 is guaranteed to do this.
The function causes an exception when there is no previous input field.
SKPF 999
Skips to the first input field of the current panel (there is a maximum of 512 fields per screenset, so this is bound to be greater than the number of previous input fields in the current panel).
SUSP delays the panel refresh until either the end of the current dialog, or until the panel is explicitly refreshed with the RFTD or RFT functions.
SUSP
None
The function is also terminated if the POP, SHP or GOP functions are invoked.
TERM terminates a screenset, shutting down all the internal storage used by that screenset.
TERM
None
If you use this function with a screenset based on Micro Focus Panels, the function deletes all of the panels used by the screenset. (See the chapter Using Dialog System for details of Micro Focus Panels.)
TIMEOUT specifies a procedure to execute after a specified period of time if there is no input in the current panel.
TIMEOUT timeout procedure
timeout |
numeric, field(sub), or register.
The number of seconds to elapse before a timeout occurs during any future input. A value of zero means wait indefinitely for input. |
procedure |
proc, field(sub), register, or null.
The procedure to execute when the timeout occurs. This can be $NULL. You are advised to define this procedure in the default procedure table, because timeout can occur on any panel. If the procedure cannot be found in the panel dialog, an error occurs. |
A typical screenset timeout procedure displays a timeout panel, containing a message, and waits for the user to type something. If the user does not respond in the timeout period, a further timeout occurs, and the same timeout procedure is entered.
To return the user to the original panel when he or she acknowledges the timeout, your timeout procedure must PUSH the current environment before doing a GOP to the timeout panel. The timeout procedure must then POP the stacked panel before it exits from the procedure.
A program loop or stack overflow can occur if the timeout panel itself times out, because the timeout panel is pushed before it is reinvoked. If this happens repeatedly, the stack will eventually overflow. If the user presses a key to make the timeout panel exit before overflow occurs, the user has to repeat the keystroke until all the stacked timeout panels have been popped, before getting back to the original panel. To prevent this, reset the timeout to zero on entry to the timeout procedure, and reset the timeout to the required value before exiting the timeout procedure.
TIMEOUT 120 P032
Specifies that procedure 032 is to be executed if no input takes place in the current panel for two minutes.
TOGF toggles the value of a field between true (1) and false (0).
TOGF item
item |
field(sub).
The name of the field. |
TOGF FLAG
Toggles the value of field FLAG.
VAL forces validation of all the input fields on the current screen when an exception condition is being monitored. VAL sets an exception condition when an invalid field is encountered and that invalid field becomes the current field.
VAL
None
This function must be used in conjunction with a function that monitors an exception condition, for example BPE, XPE, or the error key ERR. If there is no exception condition monitoring, the behavior of this function is unpredictable. for more information about the error key, see the section Error Key in the chapter Key Code List.
If there are any groups on the screen, validations on that group are performed on all fields in that group up to the current array size.
XIF tests an expression for validity, and if true, performs the procedure specified, where processing continues. When execution of the procedure is complete, control returns to dialog statement following the XIF. If the expression is false, execution continues at the dialog statement following the XIF function. The following XIF functions are available:
XIF<, XIF<=, XIF=, XIF>, XIF>=, XIFNOT=
XIF-statement expression1 expression2 procedure-name
XIF-statement |
One of the XIF statements specified above. |
expression1 |
numeric, string, field(sub), or register.
The first operand of the test. |
expression2 |
numeric, string, field(sub), or register.
The second operand of the test. |
procedure |
proc, field(sub), or register.
The procedure to perform if the test is true, or an alphabetic field that contains the name of the procedure to perform. Fields and procedures might have the same name, in which case the contents of the field are used. |
Expression1
and expression2
must be compatible types. For example, an expression cannot test a numeric
literal against an alphanumeric literal. A similar set of conditional
functions are provided that execute the target procedure and do not return
control to the calling procedure. See the IF function earlier in this
chapter.
XIF> GOODS-COST 1500 P100
If the field GOODS-COST has a value greater than 1500, executes the procedure P100, then returns to the next function.
XP executes a procedure and returns control to the next function in the dialog line.
XP procedure
procedure |
proc, field(sub), or register.
The procedure to be executed. |
XP PROCNO BEEP
Executes the procedure whose number is given by field PROCNO. When the procedure has executed, control returns to the dialog and executes the BEEP function.
XPD branches to a procedure, specified by the number in the parameter and the position of the selection bar in a group, then returns control to the next function after the procedure has been performed.
XPD group procedure
group |
The name of the group on which to act. |
procedure |
proc, field(sub), or register.
The procedure to execute if the selection bar in group is at position one, or the value to use in the destination procedure calculation. |
The destination procedure number is n+m-1, where:
procedure
.
group
. If the group does not have a selection
bar (as is the case with virtual attribute groups), m is the
position of the first visible line in the data. XPD MYGROUP 65
If the selection bar in MYGROUP is in position one, procedure 065 is executed; if the selection bar is in position four, procedure 068 is executed.
XPE executes a procedure and return control to the next function in the dialog line upon completion. The procedure is executed only if the next function in the dialog entry causes an exception condition (for example, attempting to scroll beyond the limit of a scrolling group).
XPE procedure
procedure |
proc or field(sub).
The exception procedure to be executed. |
A function that can cause an exception has an entry in its description specifying the conditions under which this happens.
XPE P045 POP
Procedure 045 is executed only if the POP function causes an exception by attempting to pop an empty stack.
XPR executes a procedure, specified by the number in the parameter and the value in the register, then returns control to the next function in the dialog line upon completion.
XPR procedure
procedure |
proc, field(sub), or register.
The procedure to execute if the value in the register is one, or the value used in the destination procedure calcualtion. |
The destination procedure number is n+m-1, where:
procedure
.
MOVE 4 $REG XPR 65
This executes procedure 068.
Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names
used herein are protected by international law.
Key Code List | Syntax of Import/Export Files |