Programming Overview | Statement List


Interactive Statements

These GRIP statements provide a means of entering data, selecting objects or choosing menu options, and displaying messages during the execution of a program.

Many of the interactive statements include a "message" parameter of text strings. Except for the CRTWRT statement, the message parameter acts as a title or an instruction which is displayed and may consist of up to 40 characters.

For the CRTWRT statement the message parameter may consist of up to 132 characters and is displayed on the graphics display tube. For the MESSG statement two message parameters may be programmed, each consisting of up to 60 characters.

Many of the interactive statements also include the parameter response which represents a response variable which you define. This variable is assigned an integer value representing the chosen option or response. For each statement containing the response parameter, there is a table showing the various responses and their numerical values.

Although the response variable may be used for a variety of purposes, one of the most common is for conditional branching such as with the JUMP command. The JUMP command is used in the examples given with the individual interactive statements.

In the JUMP statement, each field following the JUMP/ has a numeric value associated with its position. The first field after the slash (/) is number one, the second field is number two, and so on. The number in the response variable is used by the JUMP statement to determine which field you want the jump to use.

For example, if a previous statement, like CHOOSE had assigned the number 5 to the response variable, the next jump statement would jump to the label you wrote in the fifth field:

10 REJ:
20 CHOOSE/'DO YOU WANT TO CONTINUE ?',$
'YES','NO',RESP
30 JUMP/REJ:,TERM:,,,YES:,TERM:,RESP
40 YES: $$ Program Continues $$
300 TERM: HALT

By choosing YES in the CHOOSE statement, the variable RESP gets assigned the number 5. The JUMP statement then goes to the last field (by design) in its statement, where it finds the same variable, RESP. Since RESP has been assigned the value of 5 by the preceding CHOOSE statement, the JUMP statement causes the program to jump to the label, YES:, which is in the fifth field. The empty fields (where there is no label between the commas) are not used at this time.

Native Language Menu Support

No translation capability is available for GRIP statements. If your system supports the Native Language menus, only the standard prompts and options may be translated from English into a different language. Any message, string, or string list used in a GRIP statement (e.g., CHOOSE, MCHOOS, or PARAM) is not translated.