STK.Import and STK.Export

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Arrays and Data-Structures > STK. - Stack > STK.-Import/Export >

STK.Import and STK.Export

STK.Import

Previous Top Next


MiniRobotLanguage (MRL)

 

STK.Import

Import a string into the stack (delimited with $$DEL)

 

 

Intention

 

The STK.Import command is used to import a delimited string into the stack. The string is split into individual elements based on the specified delimiter, and each element is pushed onto the stack. This is useful for quickly populating a stack with data from a string.

The default delimiter for integer (i) and float (f) data types is ;. For string (s) data types, the default delimiter is Binary, which uses a specialized delimiting system for binary data.

 

 

 

Syntax

 

 

STK.Import|P1|P2[|P3]

 

 

Parameter Explanation

 

P1 - The stack handle. This is typically a variable that contains the handle of the stack.

P2 - The string to be imported into the stack. This can be a variable or a literal value.

        If the stack type is "s" and P3 is omitted then "Binary" is used, which is the only way to pack binary data that may contain all 256 ASC Characters.

       Binary is only available for Stacks with the Datatype "s".

P3 - (Optional) The delimiter used to split the string into elements. If omitted, the default delimiter is used based on the stack's data type.

 

 

Example

 

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

' STK.Import - Sample Script

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

' Create a new stack

STK.New|$$STK|s

' Define a delimited string

$$STR=Hello;World;Test

' Import the string into the stack

STK.Import|$$STK|$$STR|;

' Pop and display the values

STK.Pop|$$STK|$$VAL

DBP. Popped value: $$VAL

STK.Pop|$$STK|$$VAL

DBP. Popped value: $$VAL

STK.Pop|$$STK|$$VAL

DBP. Popped value: $$VAL

' End the stack

STK.End|$$STK

ENR.

 

 

Remarks

 

-

 

 

Limitations:

-

 

See also:

 

STK.New - Create a new stack

STK.Push - Push a value onto the stack

STK.Export - Export the stack to a string