ElseIf   

Definition:

Alternate command for the END IF command, it performs an additional IF condition check during an IF ... THEN conditional structure.

Parameter Description:


None

Command Description:

During a standard IF ... THEN conditional structure, you may wish to check another condition if the original condition fails. This 'nested IF' situation can get WAY out of hand, and once you have more than two nested conditionals, you should consider a SELECT/CASE structure. See the example.

Example:

; ELSEIF Example

; Input the user's name
name$=Input$("What is your name? ")

; Doesn't the person's name equal SHANE?
If name$ = "Shane" Then

Print "You are recognized, Shane! Welcome!"

ElseIf name$="Ron" then
Print "You are recognized too, Ron! Welcome!"

Else
Print "Sorry, you don't belong here!"

; End of the condition checking
End If

Index