McIDAS User's Guide
Version 2018.1

[Search Manual] [Table of Contents] [Go to Previous] [Go to Next]


IF

Compares expressions, using relational operators, to determine whether to execute a statement.


Syntax

IF expr relop expr statement


Parameters

expr

any valid expression

relop

any relational operator

 

=

means equal

 

< > or > <

means not equal

 

>

means greater than

 

<

means less than

 

>= or =>

means greater than or equal to

 

<= or =<

means less than or equal to

statement

step to be executed if the relationship is true


Remarks

If several statements are used, either all are done (if the relationship is true) or none are done (if it is false). To compare character strings, use only the = and < > relational operators. If statement is a let statement (a replacement statement) use the command LET.


Example

IF X=8 LET Y=13:LET J=9:GOTO 890

If X=8 is true, both LET statements and the GOTO statement are executed.


[Search Manual] [Table of Contents] [Go to Previous] [Go to Next]