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

If Statement (Perl and Access VBA Cross Reference Guide)

By Mike Prestwood

Perl versus Access VBA: A side by side comparison between Perl and Access VBA.

 
Statements
 

Common statements such as if statements, loops, etc.

If Statement

[Other Languages] 
Perl:   if..elsif..else

Notice Perl is different from most other languages in it's spelling of elsif (else is not spelled correctly).

Syntax Example:
$x = 8;
  
if ($x == 10) {
 print "X is 10.";
} elsif ($x < 10) {
 print "X is less than 10.";
} else {
 print "X must be greater than 10.";
}
Access VBA:   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
'>>>do something.
ElseIf Y = "ABC" Then
'>>>do something.
Else
'>>>do something.
End If












Sales Website: www.prestwood.com Or visit our legacy sales site: 
legacy.prestwood.com


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