ArcBasicDocs

If

Runs code only when a condition is true.

If condition Then ... [ElseIf condition Then ...] [Else ...] End If

Parameters

None.

Description

Runs some lines only when a condition is true. Any number other than 0 counts as true. On one line, everything after Then belongs to it: If lives = 0 Then GameOver(). Over several lines, the block runs to EndIf, with ElseIf and Else for the other cases.

Example

If.abs
If score > best Then    best = scoreElseIf score = best Then    Print "Equal best!"Else    Print "Try again"EndIf

See also