if( <var> <cond> <num> ) <command>


In an if() statement, the clause specified is evaluated. If it evaluates to be true then the following command is executed, otherwise script processing picks up on the next line.

The available condition codes are:

!Not equal
<Less than
>Greater than
[Less than or equal to
]Greater than or equal to


There is no restriction on what follows an 'if()' except that it cannot be a control statement or a label.

If A is zero, make it one:

if (A = 0) set A to 1

You can even chain if() statements:

set A to 1 
set B to 2 
set C to 3 
if(A = 1) if(B = 2) if(C = 3) message("Three times a lady!") 


There are internal differences in the way if() statements are handled under RISC OS and Windows, though the end result is the same.
The RISC OS implementation does not poll between processing, though it is not anticipated that this would make much difference.
The Windows version is internally recursive, however it has been tested and proven with a line of code consisting of 1024 chained if() statements (the "IfInsane" test script)... this test script will not work under RISC OS as the maximum line length is 256 characters.