Please enable JavaScript to view this site.

ESL Documentation

ESL allows you to specify a set of action statements to be performed if a given condition is true, and other action statements to be performed if the condition is false. You specify both the condition and the actions in a conditional action statement. A conditional action statement must begin with the if statement; it must contain a then clause; and it must end with the end if keywords. It can optionally contain an else clause.

 

Like other action statements, a conditional action statement can be specified within a response definition or an action routine definition. It can be specified within a loop statement, or even within another conditional action statement.

 

ESL first evaluates the boolean value specified in the if statement. The result of every boolean is either true or false. Remember that any boolean expression must be enclosed in parentheses.

 

If the boolean value is true, ESL performs the action statements specified in the then clause; the else clause, if specified, is ignored. If the boolean value is false, ESL performs the action statements specified in the else clause, if specified; the then clause is ignored.

 

After executing the then clause or the else clause, ESL continues normal program execution at the action statement, if any, immediately following the end if keywords.

 

Consider the following example:

 

response to Password

    if (Code = "BN") then

        copy 1 to Ncode

        make Menu2 invisible

        make Menu1 visible

    else

        copy 2 to Ncode

        make Menu1 invisible

        make Menu2 visible

    end if

    send Ncode to Dbase

 

Here, ESL first evaluates the boolean expression:

 

 (Code = "BN")

 

If the variable Code contains the value "BN", the expression is true, and ESL executes the then clause and then ignores the else clause.

 

copy 1 to Ncode

make Menu2 invisible 

make Menu1 visible

 

If the Code variable does not contain the value "BN", the expression is false, and ESL ignores the then clause and executes the else clause:

 

else

    copy 2 to Ncode

    make Menu1 invisible

    make Menu2 visible

 

In either case, ESL continues execution at the statement following the end if keywords. Thus, in the example, ESL performs the following action statement whether or not Code contains "BN":

 

    send Ncode to Database

 

This statement causes the value of the Ncode variable to be sent to the application program named Database.

 

The else clause is optional. For example, you can specify:

 

if ( (A > B) and (Count < MaxCount) ) then

    append Count to Log

    send Count to LogProg

end if

 

In this case, if the boolean value is false, ESL ignores the then clause and continues execution at the statement following the end if keywords.