<< Click to Display Table of Contents >> Navigation: 3. Script Language > Variable Definitions and Operations > Array -Commands > Array -Commands |
MiniRobotLanguage (MRL)
ARR.Pack Array to Var / ARR.pav
Packs the entire array into a variable.
Intention
The ARR.Pack Array to Var command, also known as ARR.pav, is designed to pack the entire array into a variable.
This is useful for storing the state of an array for later use. The packed data is binary and should be handled carefully.
•Array Packing: The command packs the entire array specified by P1 into a Variable, in binary format.
•Data Types: The packed data is binary and should be handled with care, especially because it may contain accidental variable names.
•Result Placement: If P2 is omitted, the packed array is placed on the TOS.
To restore the Packed Array from the Variable, use:
ARR.Unpack Array from Var|P1|P2
Syntax
ARR.Pack Array to Var|P1[|P2]
ARR.Pav|P1[|P2]
Parameter Explanation
•P1 - Array Number: Specifies the array number, which can range from 0 to 32.
•P2 - Output Variable (Optional): Specifies the variable that will receive the packed array. If omitted, the packed array is placed on the TOS.
Speed in Ticks:
Example
'***********************************
' ARR.-Sample for packing an array into a variable
'***********************************
VAR.$$TXT=Hallo Peter und Paul!
ARR.Dim|0|10
ARR.Set Array|0|1|Hello
ARR.Set|0|2|$$TXT
ARR.Set Array|0|10|$$TXT
ARR.pav|0|$$VAA
LEN.$$VAA|$$LEN
DBP. Lenght of packed Array is: $$LEN
' We unpack it to Array Nr.1
ARR.Unpack Array From Var|1|$$VAA
ARR.Get Array|1|1|$$TXA
MBX.$$TXA
ENR.
Remarks
-
Limitations:
-
See also:
•SDO.Arr----Small-Introduction-To-A
•Unpack-Array-from-File_Delimiter
•Unpack-Array-from-Var_Delimiiter