Search here for all the info you want in this Blog

Nested IF


Nested IF


Conditionally executes a group of statements, 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 
     if y>x then
          msgbox "y is greater"
          else
          msgbox "both are equal"
     end if
end if

No comments:

Post a Comment