ELSE

Top  Previous  Next

Action

Executed if the IF-THEN expression is false.

 

 

Syntax

ELSE

 

 

Remarks

You don't have to use the ELSE statement in an IF THEN  ..  END IF structure.

You can use the ELSEIF statement to test for another condition.

 

IF a = 1 THEN

...

ELSEIF a = 2 THEN

..

ELSEIF b1 > a THEN

...

ELSE

...

END IF

 

 

See also

IF , END IF SELECT CASE

 

 

Example

Dim A As Byte

A = 10                                   'let a = 10

If A > 10 Then                           'make a decision

Print "A >10"                         'this will not be printed

Else                                     'alternative

Print "A not greater than 10"         'this will be printed

END IF