IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
To/From Code
-Collapse +Expand Cross Ref Guide
-Collapse +Expand Members-Only
Sign in to see member-only pages.
   ► KBTo/From GuidesC++/CLI  Print This     

If Statement (C++/CLI and VB Classic Cross Reference Guide)

By Mike Prestwood

C++/CLI versus VB Classic: A side by side comparison between C++/CLI and VB Classic.

 
Statements
 

Common statements such as if statements, loops, etc.

If Statement

[Other Languages] 
C++/CLI:   if..else if..else

Same as standard C.

Syntax Example:
int x;
  
x = 8;
  
if (x == 10) {
MessageBox::Show("x is 10");
} else if (x < 10) {
MessageBox::Show("x is less than 10");
} else {
MessageBox::Show("x must be greater than 10");
}
VB Classic:   If..ElseIf..Else..End If

The End If is optional if you put your code on a single line.

Syntax Example:
//Single line example.
If X = True Then MsgBox "hello" 
 
//Complete example.
If X = True Then
MsgBox "hello"
ElseIf Y = "ABC" Then
MsgBox "goodbye"
Else
MsgBox "what?"
End If












Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2025 Prestwood IT Solutions.   [Security & Privacy]