Control structures

With the following control structures, you can control the flow of scripts and conditions:

  • CheckEvery

    Checks validity of a variable. If EVERY is passed as the first parameter, more than one agreement is possible.

    • The variable to check is passed as the second parameter.
    • value checks the value passed for validity.
    • when checks further conditions.
    • Statements after when-any are executed when one or more of the conditions are met.
    • Statements after when-all are executed when all of the conditions are met.
    • Statements after when-none are executed when none of the conditions are met.

    Example

    a = 11
    
    erg = 0
    
    c = false
    
    ;
    
    Check("every", a)
    
       value(1)
    
          erg = erg + 1 ; if a is equal to 1
    
       when(c = true)
    
          erg= erg + 1  ; if c is TRUE
    
       When-Any        
    
          message = "any"  ; if a is equal to 1 OR c is TRUE
    
       When-All
    
          message = "all"  ; if a is equal to 1 AND c is TRUE
    
       When-None
    
          message = "none" ; if a is not equal to 1 AND c is not TRUE
    
    end-check
    

  • CheckFirst

    Checks validity of a variable. If FIRST is passed as the first parameter passed, only the statements after the first agreement are executed.

    • The variable to check is passed as the second parameter.
    • value checks the value passed for validity.
    • when checks further conditions.
    • Statements after when-any are executed when one or more of the conditions are met.
    • Statements after when-all are executed when all of the conditions are met.
    • The statements after when-none are executed when none of the conditions are met.

    Example

    a = 11
    
    erg = 0
    
    c = false
    
    Check("FIRST", a)
    
       value(1)
    
          erg = 1    ; if a is equal to 1
    
       when(c = true)
    
          erg=2      ; if a is not equal to 1 AND c is TRUE
    
       When-Any        
    
          Erg=3      ; if a is equal to 1 OR c is TRUE
    
       When-All
    
          Erg=4      ; if a is equal to 1 AND c is TRUE
    
       When-None
    
          Erg=5      ; if a is not equal to 1 AND c is not TRUE
    
    end-check
    

  • If

    Checks whether the condition in brackets is valid. If so, the following commands up to End-if are executed.

    If the condition in brackets is not valid, the script is continued after the End-if command. Enclose each individual condition in brackets.

    Enclose multiple conditions linked by and or or by additional brackets.

    Example

    if (a < 10)
    
       b = 0
    
    end-if
    
    if ( (a = 10) and (b = 30) )
    
       c = 0
    
    end-if
    
    

  • IfElse

    Checks whether the condition in brackets is valid. If so, the following commands up to Else are executed. The script then continues with the statements following the respective End-If command.

    If the condition in brackets is not valid, the commands between Else and the respective End-If are executed.

    Example

    if (a < 10)
    
       b = 0
    
    else
    
       b = 1
    
    end-if 
    

  • While

    Executes the statements in a loop as long as the condition in parentheses is TRUE. The condition is evaluated before the statements are executed.

    while (a < 100)
    
       a = a + 1
    
    end-while
    

  • Region

    Defines a section of a script that you can display or hide using the plus or minus symbols. This makes large scripts more manageable.

    Example

    #region InfoText
    
    ...
    
    #endregion