Pages

If..Else


If..Else

Conditionally executes one of two sets of lines to execute, depending on the value of an expression

Syntax:

If condition Then
   [statements]
[ElseIf condition-n Then
   [elseifstatements]] . . .
[Else
   [elsestatements]]
End If

Example:

x = 10
y = 5

if x>y then
msgbox("x is greater")
else
msgbox ("y is greater")
end if

No comments:

Post a Comment