String data is data that is made up of strings of characters. The data that isplaced in word processors is string data.
Tuesday, August 4, 2009
String Data Types
String data is data that is made up of strings of characters. The data that isplaced in word processors is string data.
Monday, August 3, 2009
Simple Data Types
Data is known facts, known pieces of information. For our purposes, we will always use “data” to mean information that is available for us to manipulate in Navision Financials using C/SIDE.
Data Types
Data Types are the different kinds of information that may appear in C/SIDE. Different Data Types have different values, different meanings for those values and are manipulated differently.
Constants
Constants are data values that are written directly into our programming statements. They are called Constants because their values never change while the user is running the application. Constants can only be changed by changing the C/AL code.
Byte
A Byte is a unit of data storage space used in computers. One character stored in the computer takes up one byte of storage. Related terms are a Kilobyte (KB), which is 1024 bytes, a Megabyte (MB), which is 1024 Kb or 1,048,576 bytes and a Gigabyte (GB), which is 1024 Mb, or 1,073,741,824 bytes.
What is C/AL
C/AL (Client Application Language) is the programming language used in the Client / Server Integrated Development Environment (C/SIDE) included with Navision Solutions.
What is it used for?
The many purposes for which it is used are
. Data presentation is handled through the form objects and report objects.
· Data acquisition is mainly handled through form and dataport objects.
· Data storage and organization is handled by the table objects in conjunction with the built-in Database Management System (DBMS).
In C/SIDE, the main purpose of the programming language is data manipulation. Through C/AL, you can create business rules to insure that the data stored in the tables are meaningful and consistent with the way your customer does business. You can add new data or transfer data from one table to another (for example, a journal to a ledger). If data from multiple tables need
to be combined onto one report or displayed on one form, you will probably need to program this.
Another purpose of C/AL is to control the execution of the various C/SIDE objects. With C/AL you are able to coordinate them in a way that meets the business needs of your customer.
Validate, Testfield
IF Then Else, Case in C/AL
By using a conditional statement, you can specify a condition and one or more commands that should be executed, according to whether the condition is evaluated as TRUE or FALSE. There are two types of conditional statements in C/AL:
1. IF THEN [ELSE], where there are two choices
2. CASE, where there are more than two choices.
IF THEN ELSE statements have the following syntax.
This means that if (Condition) is true, then (Statement1) is executed. If (Condition) is false, then (Statement2) is executed.
The square brackets around ELSE
You can build even more complex control structures by nesting IF THEN ELSE statements. The following example is a typical IF THEN ELSE statement.
If 'Condition1' is false, then nothing is executed. If 'Condition1' and 'Condition2' are both true, then 'Statement1' is executed. If 'Condition1' is true and 'Condition2' is false, then 'Statement2' is executed.
The following example shows an IF statement without the optional ELSE part.
The following example shows an IF statement with the optional ELSE part.
A common error is to put an extraneous semicolon at the end of a line before an ELSE (line 4). As mentioned earlier, this is not valid according to the syntax of C/AL. The semicolon is used as a statement separator. (The end of line 4 is inside the inner IF statement.)
CASE statements have the following syntax.
1. The 'Expression' is evaluated, and the first matching value set executes the associated statement, if there is one.
2. If none of the value sets matches the value of the expression, and the optional ELSE part has been omitted, no action is taken. If the optional ELSE part is used, then the associated statement is executed.
The data type of the value sets must be the same as the data type of 'Expression' or at least be convertible to the same data type.
