|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Arrays and Data-Structures > STK. - Stack > STK.-Management > Stack Management Commands |
MiniRobotLanguage (MRL)
STK.New Command
Create a New Stack Container
Intention
STK.New is used to allocate a new container for stack operations. It initializes a stack with a specified data type (String, Integer, or Floating Point) and returns a handle for further interaction.
This command ensures dynamic memory allocation for stacks, facilitating efficient storage and management of data in your application.
Syntax
STK.New|$$STK[|s/i/f]
Parameter Explanation
$$STK - Handle of the newly allocated stack.
s/i/f - Specifies the data type for the stack. Options include:
s - String
i - Integer
f - Floating Point
Example
' Allocate a new stack with integer type
STK.New|$$STK|i
' Use the handle for further operations
STK.Push|$$STK|42
STK.End|$$STK
Remarks
Ensure that you free unused stacks using STK.End to avoid memory leaks.
Limitations:
- Only supports three data types: String, Integer, and Floating Point.
See also:
• STK.Push
• STK.End