Conditionally executes a group of statements,
depending on the value of an expression. Condition is an
expression that evaluates to either True or False.
The condition is usually a comparison, but it can
be any expression that evaluates to a numeric value. LC
Basic interprets this value as True or False; a zero numeric
value is False, and any nonzero numeric value is considered
True. If condition is True, LC Basic executes all
the statements following the If keyword.
Command EndIf is required. Command
Else is optional.
Examples:
ret = MsgBox ("Pres YES or NO","",MB_YESNO)
If ret = IDYES
MsgBox "Yes was pressed"
Else
MsgBox "NO was pressed"
EndIf
In LC Basic a value False is the same as 0 and
any other value is equivalent to True:
a = 10
If a
MsgBox "a is True"
EndIf
a = -1
If a
MsgBox "a is True"
EndIf