Dim Array

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Variable Definitions and Operations > Array -Commands >

Dim Array

ARR.Dim Array

Previous Top Next


MiniRobotLanguage (MRL)

 

ARR.Dim Array

Reserves memory for a specified array, setting its size.

 

clip0707

 

Intention

 

The ARR.Dim Array command is designed to reserve memory for an array.

This is particularly useful for pre-allocating memory for data storage, thereby optimizing performance.

It is not necessary to use the ARR.DIM Commands to reserve Memory for an Array, as the Smart Package Robot will do it automatically

when you try to write to a specified Array-Element.

However increasing an Array "Step by Step" is always slower then reserving the memory at once.

Having said that you can also just access the last Array Element and it will automatically be dimensioned to that size.

If you have dimensioned an ARR.-Array to 100 and you decide that you need 200 Elements, you can just use this command to increase the Number of Elements to 200.
This will not affect the currently stored Elements. To clear an Array, us the ARR.Clr or ARR.Clm - Command.

 

 

 

Syntax

 

ARR.Dim Array|P1|P2

 

 

Parameter Explanation

 

P1 - Array Number: Specifies the array number, ranging from 0 to 32. The Smart Package Robot currently supports a total of 33 arrays.

P2 - Number of Elements: Zero-based. Specifies the number of elements to be reserved for the array. This sets the size of the array.
      If this number is 10, Elements from 0 to 10 will be reserved.

 

 

Speed in Ticks:

 

This command uses typically between 400 to 500 Ticks strongly depending on the amount of Memory that is to be reserved.

 

Example

 

'******************************************

'  ARR.Dim Array. - Sample

'******************************************

ARR.Dim Array|1|32

 

 

END.

 

 

 

Remarks

 

-

 

 

 

Limitations:

ARR.-Arrays are generally 1-dimensional by design. You can make them 2D or 3D using Macros.

 

 

 

See also:

 

    VAB. - Variable Binary

    VAC. - Variable reCt

    VAN. - Variable Numeric

    VAO. - Variable Once

    VAP. - Variable Point

    VAR. - Variable Set Value/Clear

    VAS. - Variable with String

    VAV. - Variables with Variables

    VBA. - Variable Binary Append

    CAL. - mathematical CALculation

    2.1 : - Definiton-Command

 

See also:

ARR_---3D---Arrays

ARR_---4D---Arrays

SDO.Arr----Sample-Script

SDO.Arr----Small-Introduction-To-A

Append Array

Clm Array

Clr Array

Dim Array

Get Array

Get FP Array

Get INT Array

Pack-Array-to-File

Pack-Array-to-FileDelimiter

Pack-Array-to-Var

Pack-Array-to-Var

Send to AI

Set Array

Set FP Array

Set INT Array

Unpack-Array-from-File

Unpack-Array-from-File_Delimiter

Unpack-Array-from-Var

Unpack-Array-from-Var_Delimiiter