Showing posts with label Arrays. Show all posts
Showing posts with label Arrays. Show all posts

Syntax Of Arrays

Syntax Of Arrays In Microsoft Dynamics

Synatax

An array have to define in the following format of syntax only in the Navision (Microsoft Dynamics NAV) C/AL.

Identifier  [Index Expression1] , [Index Expression 2] , etc .

The 'Identifier' is the Variable identification of an array and this need to include any types of arrays. Only the difference occur in the 'Index Expression' area only. ie, If we need Single dimension array then we need only Index Expression1.  In that case following will be the sysntax

Identifier  [Index Expression1]

Exapmple : A[3]

In the case of Two dimensional  array we have to mension upto Index Expression2. 

And in the case of Three Dimensional Arrays we have to mension Index Expression1, Index Expression2, Index Expression3.

How to assingn values to the Arrays?

To assign values to the array element 4 as 50 then you have to mension in the following format.

A[4] := 50;

Arrays

Arrays In Microsoft Dynamics NAV

Definition:

Arrays are special type of variables that have more functionality than the simple variable or normal variables. 

An Arrays is a complex variable that actually holds group of variables and these groups is defined once with a single identifier and a single datatype.

For Example:

Identifier : QuantityArray

Data Type: Integer

Diffrent Terms of Arrays

Index

Index is used to refer to single element in an array

Element

An element is a single variable in an array.

To access the 5 element in the array of QuantityArray, you have to specify like

QuantityArray[5]

Dimension

An array can be specified in different dimensions. In the abow example QuantityArray[5] is a type of one dimensional array. Array dimension can be one or more. But one dimension arrays more simpler than multidimension arrays. For specifying the Complex datas we are using Muli dimensional arrays.

Related Posts with Thumbnails