proc.if Command/PROC

proc.if

Command proc.if Command/PROC
Applicable release versions: AP, R83
Category PROC (92)
Description performs a conditional expression.

Fist form: The "e" operand tests for a specified message number from the "dm,messages," file. If true, the specified PROC command is performed.

Second form: The "s" operand tests for an active list. May be used after a "select", "sselect", "qselect" or "get-list" command.

Third form: This tests the contents of the buffer location specified in the "a{param.number}" expression with any logical or pattern matching operator, and performs the specified PROC command if successful. The optional ",n" argument allows only the specified number of characters to be compared.

The logical operators allowed in constructing PROC conditionals are: "=" equal to; "#" not equal to; "<" less than; ">" greater than; "[" less than or equal to; "]" greater than or equal to. The "#" character tests for the absence of the expression, when used on the left of the a-command.

Pattern matching operators for composing "match.strings":

(na) accepts "n" alphabetic characters only.
(nn) accepts "n" numeric characters only.
(nx) accepts "n" of any characters.
('string') accepts literal string.

The "n" parameter in the pattern match string specifies the length of the match operator field. A length specification of zero (0) allows variable length input. The parentheses are required around the match.strings.
Syntax if {#} e {operator message.number} command
if {#} s command
if {#} a{param.number}{,n} {operator {match.string}} command
Options
Example
if e = 401 xno items were selected... 
Checks for error message 401 and stops/returns if present.

if a # (3n'-'2n'-'4n) oinvalid ss#.
Checks for 3 numbers, a dash, 2 numbers, a dash, and 4 more numbers.

if a = x xdone.
Checks the currently active input buffer location for the presence of the 
letter "x".

if a = (0n) go 10
Checks the currently active input buffer location for the presence of zero or 
more numbers.

if a1,1 = q x proc terminated voluntarily
Checks the first character of the currently active input buffer location for 
the presence of the letter "q".

if # a1 go 10
Checks for the absence of a value in the first location of the currently active 
input buffer.
Purpose
Related proc
proc.go
primary.input.buffer
sib