I.T. Discussion Community!
-Collapse +Expand
Prism
Search Prism Group:

Advanced
-Collapse +Expand Prism To/From
To/FromCODEGuides
-Collapse +Expand Prism Study Test
PRESTWOODCERTIFIED
-Collapse +Expand Prism Store
PRESTWOODSTORE
   ► KBTo/From GuidesReferenceOperators  Print This    All Groups  

Assignment (Cross Ref > Operators)

Assignment

Languages Focus

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

More Info

ASP Classic:   =

ASP Classic uses = for it's assignment operator.

Syntax Example:
FullName = "Randy Spitz"
Age = 38

More Info

C#:   =

C# uses = for it's assignment operator.

Syntax Example:
int Age;
string FullName;
  
Age = 42;
FullName = "Randy Spitz";


More Info

C++:   =

C++ uses = for it's assignment operator.

Syntax Example:
int Age;
string FullName; //#include <string>
  
Age = 42;
FullName = "Randy Spitz";

More Info

C++/CLI:   =

C++/CLI uses = for it's assignment operator.

Syntax Example:
int Age;
string FullName;
  
Age = 42;
FullName = "Randy Spitz";

More Info

Corel Paradox:   =

ObjectPAL uses = for it's assignment operator.

Syntax Example:
var
 FullName String
   Age SmallInt
endVar
  
FullName = "Randy Spitz"
Age = 42


Linked Certification Question(s)

The following are practice certification questions with answers highlighted. These questions were prepared by Mike Prestwood and are intended to stress an important aspect of this KB post. All our practice questions are intended to prepare you generally for passing any certification test as well as prepare you for professional work.

Beginner

1 Beginner Level Question

Question #1: Multiple Choice

Which is the correct syntax to assign a string value to a string variable?

Answer:
1. 
Team := "49ers"
2. 
Team == "49ers"
3. 
Team = "49ers"
4. 
Team = '49ers'
5. 
Team << "49ers"

More Info

 

Delphi:   :=

Delphi uses := for it's assignment operator.

Syntax Example:
var
  FullName: String;
  Age: Integer;
begin
  FullName := "Randy Spitz";
Age := 38;
end

More Info

Delphi Prism:   :=

Same as Delphi.

Syntax Example:
FullName: String;
Age: Integer;
  
FullName := "Randy Spitz";
Age := 38;

More Info

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;

More Info

KB Post:  JavaScript Operators

More Info

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;

Syntax Example:
$FullName = "Randy Spitz";
$Age = 38;

More Info

PHP:   =

PHP uses = for it's assignment operator.

Syntax Example:
$fullname = "Randy Spitz";
$age = 38;

More Info

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

More Info

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




Linked Certification Question(s)

The following are practice certification questions with answers highlighted. These questions were prepared by Mike Prestwood and are intended to stress an important aspect of this KB post. All our practice questions are intended to prepare you generally for passing any certification test as well as prepare you for professional work.

Beginner

1 Beginner Level Question

Question #1: Multiple Choice

Which statement is the correct syntax to assign a string value to a string variable?

Answer:
1. 
Team := "Raiders"
2. 
Team == "Raiders"
3. 
Team = "Raiders"
4. 
Team = 'Raiders'
5. 
Team == 'Raiders'

More Info

 





Follow PrestwoodBoards on: 


©1995-2019 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech