SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Dynamics NAV 2013
Shan Abeywicrema | Jinasena Infotech | www.jinasenainfotech.com
 Assignment statements assign a value to a
variable. This means that a variable can
represent different values at different times.
 Assignment means to set a variable to a
value.
 When a variable has a value, it keeps that
value until another value is assigned to it, or
until the current set of code ends and the
system no longer keeps track of the variable
 A statement in programming context is a
single complete programming instruction
that is written as code
 Certain function calls, such as the MESSAGE
function, can be a statement on their own.
They are known as function call statements
 [return value :=] <Function Call>
 Example:: MESSAGE function
 The syntax of an assignment statement is
almost as easy as the syntax of the function
call statement. The syntax is as follows
 <variable> := <expression>
 Example :: Integer Number:=10;
 The “colon equals” (:=) is known as the
assignment operator. You use it to assign a
value or an expression that evaluates to a
value to a variable.
 :=
 A single programming statement may span
several code lines; one code line may consist
of multiple statements.
 Therefore, the C/AL compiler must be able to
detect when one statement ends and another
statement begins.
 [ <statement> { ; <statement> } ]
 Example Integer Num:=10;
 Before you can assign a variable to a value,
the type of the value must match the type of
the variable. However, within limits, you can
automatically convert certain types in an
assignment operation.
 You can convert variables of string data types
(code and text) automatically from one to the
other. For example, if Description is a
variable of type Text, and CodeNumber is a
variable of type Code, the following
statement is valid:
 CodeNumber := Description
 Automatic conversion does have limitations. For example, if the value of the Description text
variable has more characters than the length of the CodeNumber variable, an error occurs
when the program runs and executes this statement. This type of error is known as a run-time
error.
 Variables of the numeric data types (integer,
decimal, option, and char) can convert
automatically from one to another
 Demonstration:
Create a Simple Assignment Statement
 Expression
An expression specifies the information to
generate a desired value. Similar to a variable
and a constant, an expression has a type and
a value. expression is evaluated at run time to
determine its value.
Quantity * UnitCost
ASSIGNMENT STATEMENTS AND

Weitere ähnliche Inhalte

Was ist angesagt?

Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
Tech_MX
 
Constraints In Sql
Constraints In SqlConstraints In Sql
Constraints In Sql
Anurag
 

Was ist angesagt? (20)

Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
Constraints In Sql
Constraints In SqlConstraints In Sql
Constraints In Sql
 
Nested Queries Lecture
Nested Queries LectureNested Queries Lecture
Nested Queries Lecture
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
Dbms lab Manual
Dbms lab ManualDbms lab Manual
Dbms lab Manual
 
Array ppt
Array pptArray ppt
Array ppt
 
JDBC – Java Database Connectivity
JDBC – Java Database ConnectivityJDBC – Java Database Connectivity
JDBC – Java Database Connectivity
 
Complements of numbers
Complements of numbersComplements of numbers
Complements of numbers
 
Features of c language 1
Features of c language 1Features of c language 1
Features of c language 1
 
The Loops
The LoopsThe Loops
The Loops
 
Oracle: Control Structures
Oracle: Control StructuresOracle: Control Structures
Oracle: Control Structures
 
Data structure ppt
Data structure pptData structure ppt
Data structure ppt
 
Fundamentals of Language Processing
Fundamentals of Language ProcessingFundamentals of Language Processing
Fundamentals of Language Processing
 
Linked List
Linked ListLinked List
Linked List
 
C Programming: Control Structure
C Programming: Control StructureC Programming: Control Structure
C Programming: Control Structure
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with ExamplesDML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
 
PHP LICTURES ..........
PHP LICTURES ..........PHP LICTURES ..........
PHP LICTURES ..........
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design Basics
 

Ähnlich wie ASSIGNMENT STATEMENTS AND

C++ PROGRAMMING BASICS
C++ PROGRAMMING BASICSC++ PROGRAMMING BASICS
C++ PROGRAMMING BASICS
Aami Kakakhel
 
Javascript sivasoft
Javascript sivasoftJavascript sivasoft
Javascript sivasoft
ch samaram
 

Ähnlich wie ASSIGNMENT STATEMENTS AND (20)

C++ PROGRAMMING BASICS
C++ PROGRAMMING BASICSC++ PROGRAMMING BASICS
C++ PROGRAMMING BASICS
 
Opps concept
Opps conceptOpps concept
Opps concept
 
C presentation! BATRA COMPUTER CENTRE
C presentation! BATRA  COMPUTER  CENTRE C presentation! BATRA  COMPUTER  CENTRE
C presentation! BATRA COMPUTER CENTRE
 
Chapter3: fundamental programming
Chapter3: fundamental programmingChapter3: fundamental programming
Chapter3: fundamental programming
 
Switch Case Statement
Switch Case StatementSwitch Case Statement
Switch Case Statement
 
Variables and calculations_chpt_4
Variables and calculations_chpt_4Variables and calculations_chpt_4
Variables and calculations_chpt_4
 
Intro to Scala
 Intro to Scala Intro to Scala
Intro to Scala
 
Introduction to Programming Fundamentals 3.pdf
Introduction to Programming Fundamentals 3.pdfIntroduction to Programming Fundamentals 3.pdf
Introduction to Programming Fundamentals 3.pdf
 
Unit 1 question and answer
Unit 1 question and answerUnit 1 question and answer
Unit 1 question and answer
 
Shanks
ShanksShanks
Shanks
 
Embedded C The IoT Academy
Embedded C The IoT AcademyEmbedded C The IoT Academy
Embedded C The IoT Academy
 
Pc module1
Pc module1Pc module1
Pc module1
 
CS-XII Python Fundamentals.pdf
CS-XII Python Fundamentals.pdfCS-XII Python Fundamentals.pdf
CS-XII Python Fundamentals.pdf
 
Handout # 4 functions + scopes
Handout # 4   functions + scopes Handout # 4   functions + scopes
Handout # 4 functions + scopes
 
Javascript sivasoft
Javascript sivasoftJavascript sivasoft
Javascript sivasoft
 
The future of DSLs - functions and formal methods
The future of DSLs - functions and formal methodsThe future of DSLs - functions and formal methods
The future of DSLs - functions and formal methods
 
Data Types, Variables, and Constants in C# Programming
Data Types, Variables, and Constants in C# ProgrammingData Types, Variables, and Constants in C# Programming
Data Types, Variables, and Constants in C# Programming
 
Dot net programming concept
Dot net  programming conceptDot net  programming concept
Dot net programming concept
 
MODULE_2_Operators.pptx
MODULE_2_Operators.pptxMODULE_2_Operators.pptx
MODULE_2_Operators.pptx
 
Web programming
Web programmingWeb programming
Web programming
 

ASSIGNMENT STATEMENTS AND

  • 1. Dynamics NAV 2013 Shan Abeywicrema | Jinasena Infotech | www.jinasenainfotech.com
  • 2.  Assignment statements assign a value to a variable. This means that a variable can represent different values at different times.
  • 3.  Assignment means to set a variable to a value.  When a variable has a value, it keeps that value until another value is assigned to it, or until the current set of code ends and the system no longer keeps track of the variable
  • 4.  A statement in programming context is a single complete programming instruction that is written as code
  • 5.  Certain function calls, such as the MESSAGE function, can be a statement on their own. They are known as function call statements  [return value :=] <Function Call>  Example:: MESSAGE function
  • 6.  The syntax of an assignment statement is almost as easy as the syntax of the function call statement. The syntax is as follows  <variable> := <expression>  Example :: Integer Number:=10;
  • 7.  The “colon equals” (:=) is known as the assignment operator. You use it to assign a value or an expression that evaluates to a value to a variable.  :=
  • 8.  A single programming statement may span several code lines; one code line may consist of multiple statements.  Therefore, the C/AL compiler must be able to detect when one statement ends and another statement begins.  [ <statement> { ; <statement> } ]  Example Integer Num:=10;
  • 9.  Before you can assign a variable to a value, the type of the value must match the type of the variable. However, within limits, you can automatically convert certain types in an assignment operation.
  • 10.  You can convert variables of string data types (code and text) automatically from one to the other. For example, if Description is a variable of type Text, and CodeNumber is a variable of type Code, the following statement is valid:  CodeNumber := Description  Automatic conversion does have limitations. For example, if the value of the Description text variable has more characters than the length of the CodeNumber variable, an error occurs when the program runs and executes this statement. This type of error is known as a run-time error.
  • 11.  Variables of the numeric data types (integer, decimal, option, and char) can convert automatically from one to another
  • 12.  Demonstration: Create a Simple Assignment Statement
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.  Expression An expression specifies the information to generate a desired value. Similar to a variable and a constant, an expression has a type and a value. expression is evaluated at run time to determine its value. Quantity * UnitCost