IF S

Conditionally executes a Proc command based on the presence or absence of an active select list.

Syntax

IF {#} S command

Syntax elements

# tests for the absence of a select list.

command is a valid Proc command.

Operation

IF S command executes command if a select list is active.

IF # S command executes command if no select list is active.

Examples

PQN
IF S G F
1 OEnter list name +
IP %1
IF # %1 G 1
HGET-LIST
A1
STON
M
HPQ-SELECT 1
P
M
MV %1 !1
IF # %1 G F
T %1
G B
M OAll Item-Ids Output
X

This Proc checks for an active list. If one exists, it is read into select register 1. If there is no active list, the user is prompted for a list name. Once a list is retrieved, its item-ids are output in turn before the Proc terminates.

IF # S G 200
IP?
.
.
.

If there is no active select list, go to label 200; otherwise prompt for input.