proc.if

Command/PROC, Releases: AP and R83

If..then conditional.

Syntax

if {#} e {operator message.number} command if {#} s command if {#} a{param.number}{,n} {operator {match.string}} command

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.

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.

See Also

Command Name Type Description
proc Definition List of PROC subjects.
proc.go Command Goto statement label.
primary.input.buffer Definition Description of Primary Input Buffer.
sib Definition Description of Secondary Input Buffer.

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.