Syntax for all of the If / Else Statements:
Below are three different scenerios for using the if/else statement.
Respond to only ONE condition:
|
If the condition is TRUE....do this. |
If the condition is TRUE....do this. |
If something is = true then
'statement to execute
end if |
If something is = false then
'statement to execute
end if |
Respond to BOTH conditions:
|
If the condition is TRUE....do this BUT if it is FALSE then do something else. |
If something is = true then
'statement to execute
Else
'statement to execute
end if |
Respond to EACH condition individually and then
to BOTH conditions:
If the condition is TRUE....do this BUT if it is FALSE then do something else. Then do something new at the end of checking.
|
If something is = true then
'statement to execute
ElseIf
'statement to execute
Else
'statement to execute no matter what
end if |
VB.NET vs. C#
Variables
Decisions
Built In Functions