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     

String Concatenation (Perl and Access VBA Cross Reference Guide)

By Mike Prestwood

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

 
Operators
 

A language symbol used for assignment, comparison, computational, or as a logical.

String Concatenation

[Other Languages] 
Perl:  "String Concatenation" .

Perl uses a period (.) known as a dot to concatenate strings.

Syntax Example:
$fname = "Mike";
$lname = "Prestwood";

$fullname = $fname . $lname . "
";

print "My name is " . "Mike.
";
Access VBA:  "String Concatenation" & or +

Although you can use either a & or a + to concatenate values, my preference is to use a + because more languages use it. However, if you use & then some type conversions are done for you. If you use + you will sometimes have to cast a value to concatenate it. For example, you will have to use CStr to cast a number to a string if you use the + operator as a concatenation operator.

Syntax Example:
Dim FirstName As String
Dim LastName As String
 
FirstName = "Mike"
LastName = "Prestwood"
 
MsgBox "Full name: " & FirstName & " " & LastName
 
MsgBox "2+2=" + CStr(2+2)












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


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