<< Click to Display Table of Contents >> Navigation: 3. Script Language > Variable Definitions and Operations > Array -Commands > Dim Array |
MiniRobotLanguage (MRL)
ARR.Dim Array
Reserves memory for a specified array, setting its size.
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:
• VAR. - Variable Set Value/Clear
• VAV. - Variables with Variables
• VBA. - Variable Binary Append
• CAL. - mathematical CALculation
See also:
•SDO.Arr----Small-Introduction-To-A
•Unpack-Array-from-File_Delimiter
•Unpack-Array-from-Var_Delimiiter