Commands & Syntax > Commands > Macro Flow Control >

www.perfectkeyboard.com

 

ELSE - < else > ... [Free]

 

ELSE
<else>
Available in: Free edition

The command begins an optional block of macro steps. The block is executed if the associated "if" command expression is evaluated as "false". The command can be only use together with one of an "if" command.

 

 

Example (Macro Steps):

 

1

<#> <#> This example shows how to use "if" command.

2

Macro execution: ONLY COMMANDS

3

Variable SET "vNum=", Message text="Type a number:"

4

IF 100<(30+%vNum%)

5

Message SHOW "Information" : "Yes, this is true: 100<30+%vNum%" (other parameters: x = -100, y = -100, Window title = Message, Buttons = OK, Timeout (seconds) = , Always on top = ).

6

ELSE activate

7

Message SHOW "Error" : "No, it is not true: 100<30+%vNum%" (other parameters: x = -100, y = -100, Window title = Message, Buttons = OK, Timeout (seconds) = , Always on top = ).

8

ENDIF

Example (Plain Text):

 

<#> This example shows how to use "if" command.

<#>

<cmds>

<varset>("vNum=","Type a number:")

<if>("100<(30+%vNum%)")

<msg>(-100,-100,"Yes, this is true: 100<30+%vNum%","Message",1,,0)

<else>

<msg>(-100,-100,"No, it is not true: 100<30+%vNum%","Message",1,,2)

<endif>