StringStackSize Parameter
Default Value: 512
Minimum Value: 32
Maximum Value: 131072
Units: None
Type: int
Use the StringStackSize parameter to specify the maximum size of the string stack memory that is available for this task. The string stack memory is used to store and manipulate strings. The parameter value specifies the number of 64-bit words that is allocated for the string stack. The string stack is a separate area of memory than the program stack, which is used to store memory for local variables, function arguments, function calls, and calls to property get and set accessors. To configure the program stack, use the StackSize Parameter.
String values that are returned from functions, property get accessors, and string concatenations use space on the string stack. The number of values that a string value consumes on the string stack depends on its length. The length of a string value is the number of characters that the string contains. Refer to the formula that follows to calculate the number of values that a string value consumes on the string stack.
The example that follows shows the concatenation of two string values to produce a new string value. The length of the first string is 4 characters and the length of the second string is 3 characters, so the concatenation of the two strings produces a string with a length of 7 characters. The concatenation operation consumes 6 values of the string stack.
// The following code concatenates "1234" and "567".
// The resulting string (“1234567”) has a string length of 7 characters.
// Number of stack values = 3 + floor(7 / 2) = 6
$myString = $myString + "567"
The memory of the string stack can be exhausted and cause a string stack overflow error in some cases. If a string stack overflow error occurs, then do one or more of the following:
-
Reduce the string lengths of strings that you are concatenating.
-
Return strings with shorter string lengths from functions or property get accessors.
-
Increase the value of the StringStackSize parameter.
WARNING: Do not edit this parameter from within an AeroScript program. Edit this parameter only in the Configure workspace of AerotechAutomation1 Studio.
IMPORTANT: You must reset the controller for these changes to have an effect.