## WorkShop Visual Replay Command Syntax - Condition clauses

#### Keywords

- if
- else
- elif
- endif

#### Synopsis

        if expression
    	actions
        elif expression
    	actions
        else
    	actions
        endif

#### Inputs

- expression - an expression which evaluates to true or false
- actions - one or more user actions

#### Description

The if statement allows the control flow through a script to be sensitive to conditions inside the application as it is being run. For each if there must be a matching endif. If necessary the statement can include optional alternatives (elif) and a default catch-all else condition.

#### Example

        in my_shell
    	if !my_option_menu->menuHistory:default_option
    	    message FAIL: bad setting for my_option_menu
    	    message Setting should be:
    	    printres my_option_menu->menuHistory:default_option
    	else
    	    message setting ok for my_option_menu
    	endif

See also:

- WorkShop Visual Replay Command Syntax