Posts

Showing posts with the label Data Types

Self Practise Topic 2

Self Practise Topic 2 Varibles & Datatypes Area 1)Create an Integer Item named mynum and store the value 100 and diplay the data in a Message Box when the page run. 2) Create a program to add two decimal numbers and display the result in a Message box when the object run. Answers: 2.1) Here i am not specifying how to define a variable, i think you already understand how to define that from the previous post. Only diff is that you have to define the variable in the Datatype column as integer.  The program code for display that was -----------------------------------------------------------  mynum := 5; MESSAGE('The Value Of %1 Is %2', 'mynum', mynum); ----------------------------------------------------------- 2.2) For doing this you have todefine 2 variables as Decimal numbers. Let us consider Num1 and Num2 , the result storing and display from the Result variable the programming codes are as follows ---------------------------------------------------------- Num1 ...

Sample Program to display a Stored Data

Image
Sample Program to display a Stored Data This session describes how to define a variable as particular Data type and display their contents. First up all we will see the assigning a text to a 'text' variable and display there contents in a message box. For doing this you have to first define the variable as text variable for that goto the Tools -> Object Designer  Open the object you want to do coding. (for how to open a C/AL Editor see the C/AL Editor page)  After open the C/AL editor goto the View -> C/AL Globals Go to the Variables tab and enter the Name as your text name let us say "sampletext" Go to the Datatype column , here you can specify the datatype of the variable  Got to the Length column type 30. ie, is the space where specifies the length of the text. Variables defining area looks like follows After defining this press Esc and goto the normal C/AL Editor window and type the following text in the OnRun() --------------------------------------------...

Data Types

Definition: Data Types are diffrent kinds of information that may appear in the C/SIDE Environment. Different data types having different values and each of them having diffrent way of representation.  Example: If we have two data types "12" and "36" and add them, we will get different values according to different data types. ie, If they are numbers then the result would be 48 and on the other hand if we consider these are text then the result would be "1236" only. Data Types can be mainly divided in to 4 types Simple Datatypes Numeric Data Types String Data Types Boolean, Date and Time Simple Datatypes: Simple data types are those types of data which have only one value and which cannot be broken up into other values of different types.                                                     Numeric Data ypes: Numeric Data Types are all forms of numbers or amounts. TYPE RANGE SIZE EXAMPLE DEFAULT VALUE Integer From 2,147,483,647 to + 2,147,483,647 4 Bytes ...