Common assignment operators for languages include =, ==, and :=. An assignment operator allows you to assign a value to a variable. The value can be a literal value like "Mike" or 42 or the value stored in another variable or returned by a function.
Access VBA:
=
Access uses = for it's assignment operator.
Syntax Example:
Dim Age As Integer Dim FullName As String FullName = "Randy Spitz" Age = 38
ASP Classic:
=
ASP Classic uses = for it's assignment operator.
C#:
=
C# uses = for it's assignment operator.
Syntax Example:
int Age; string FullName; Age = 42; FullName = "Randy Spitz";
C++:
=
C++ uses = for it's assignment operator.
Syntax Example:
int Age; string FullName; //#include <string> Age = 42; FullName = "Randy Spitz";
C++/CLI:
=
C++/CLI uses = for it's assignment operator.
Syntax Example:
int Age; string FullName; Age = 42; FullName = "Randy Spitz";
Corel Paradox:
=
ObjectPAL uses = for it's assignment operator.
Syntax Example:
var FullName String Age SmallInt endVar FullName = "Randy Spitz" Age = 42
Delphi:
:=
Delphi uses := for it's assignment operator.
Syntax Example:
var FullName: String; Age: Integer; begin FullName := "Randy Spitz"; Age := 38; end
Delphi Prism:
:=
Same as Delphi.
Syntax Example:
FullName: String; Age: Integer; FullName := "Randy Spitz"; Age := 38;
Java:
=
Java uses = for it's assignment operator.
JavaScript:
=
JavaScript uses = for it's assignment operator.
Syntax Example:
//Regular assignment. LastName = 'Spitz'; //Variable declaration with assignment. var FullName = 'Randy Spitz'; var Age = 38;
Perl:
=
Perl assignment operators:
=
Assignment
$x = 8;
+=
Addition
$x += 8;
-=
Substraction
$x -= 8;
*=
Muliplication
$x *= 8;
/=
Division
$x /= 8;
%=
Modulus
$x %= 8;
**=
Exponent
$x **= 8;
PHP:
=
PHP uses = for it's assignment operator.
VB Classic:
=
VB Classic uses = for it's assignment operator.
Syntax Example:
Dim Age As Integer Dim FullName As String FullName = "Randy Spitz" Age = 38
VB.Net:
=
VB.Net uses = for it's assignment operator.
Syntax Example:
Dim Age As Integer Dim FullName As String FullName = "Randy Spitz" Age = 38