ifr Statement

The ifr statement tests the result of a logical expression.

Syntax

ifr logical.exp [then|else] statement.block

ifr logical.exp then statement.block else statement.block

Description

Each attribute of the first element of the expression is tested against the target. Depending on whether one of the attributes in the expression evaluates to either true or false, the statements following the then or else, respectively, clauses are executed.

Example(s)

001 print "Input string":;input str2

002 str1="a":@am:"b"

003 ifr str1=str2 then print "match" else print "no match"

run bp testifr

Input string?a

match

run bp testifr

Input string?b

match

run bp testifr

Input string?ab

no match

See Also

! Logical Operator, $options Statement, = Assignment Operator, Boolean Evaluation, if Statement, Logical Expressions, match Relational Operator, not() Function, null Statement, rewind Statement, Statement Blocks, Statements and Functions, then/else Statement Blocks