Avisaro Online Documentation - Wiki
Impressum Kontakt Sitemap

IF ... THEN ... ELSE

Description

For condition testing, the Scripting Language defines the IF ... THEN statement. If the condition evaluates to true, code that follows the IF...THEN statement is executed, otherwise not. If there is an optional ELSE, code after that ELSE is executed when the condition evaluates to false. There must be an END IF at the end of every IF...THEN block.

Example

The following program prints the relationship to 5 of the numbers from 0 to 10:

outmode -2
for n = 0 to 10 
    print n;
    if n < 5 then 
        print " is less than 5" 
    else
        pint " is greater or equal to 5"
    end if
next

Remarks

IF...THEN can be nested. That is, code inside IF...THEN and ELSE blocks can contain other IF...THEN and ELSE blocks.