HP 3000 Manuals

SELECT Command [ HP ALLBASE/4GL Developer Reference Manual Vol. 2 ] MPE/iX 5.0 Documentation


HP ALLBASE/4GL Developer Reference Manual Vol. 2

SELECT Command 

The SELECT command executes one command in a list of commands according
to the value in the communication area field *PASS.

Format 

SELECT command; command;...

Window 

[]
Parameters command The command to be executed. The command can be any of the following: * ENTER * EXIT * EXTERNAL * MESSAGE * PROCEED * SERIES * TOP * VISIT * ZIP You must separate the commands in the command list with semicolons. Description The SELECT command executes a specified command from a list of logic commands. The value in the communication area field *PASS determines the number of the command that the SELECT command executes. If the number in *PASS does not correspond to a command in the command list, HP ALLBASE/4GL executes the command in the logic block following the SELECT command. You must terminate all commands other than the last command in the list with a semicolon. If you enter the commands via the SELECT window, the semicolon terminator is optional. In this case, HP ALLBASE/4GL inserts the semicolon automatically if you don't specify it during entry. You can use the SELECT command in conjunction with a CHECK command. The CHECK command sets the content of *PASS, and the SELECT command chooses the relevant command to execute from the command list.
NOTE The SELECT command only executes one command. If you enter more than one command in the same field via the window without the intervening semicolon, HP ALLBASE/4GL will interpret the commands as two separate commands in the selection list.
Example 1 5 MOVE * *PASS 6 SELECT ENTER 5; ENTER 12; ENTER 15; PROCEED main_menu These commands take the number from the current screen field and execute the command in the command list that corresponds to that number. For example, if the current screen field contains the number 2, HP ALLBASE/4GL executes the command ENTER 12 since this is the second command in the command list. Example 2 3 SCREEN get_command 4 CHECK *S01 *TABLE=commands 5 SELECT PROCEED command_1; PROCEED command_2; EXIT 6 MESSAGE reenter 7 ENTER 3 These commands accept input from the screen get_command and validate the data against the table commands. The CHECK command places its result into *PASS. The SELECT command then uses this value to execute the appropriate HP ALLBASE/4GL command from the command list. If the value in *PASS is not between 1 and 3, HP ALLBASE/4GL displays the message reenter.


MPE/iX 5.0 Documentation