Copyright © 2007 • MCL Technologies • All Rights Reserved
www.mcl-collection.com
Chapter 5 : Using Processes
October 2007 Page
5.8.8. Variable Substring
General introduction The Variable Substring command allows you to extract from a variable a
certain character or group of characters based upon their position in a
variable and save the extracted character(s) into another variable.
To extract data based upon field separators in a variable, use the
Variable Extract process.
Variable Substring To remove characters from a variable, proceed as follows:
1 Add the process Variable Substring to your label program
2 In the Input Value box, select the variable from which you want
to ‘substring' a certain number of characters.
3 In the From Position box and the To Position box, type
respectively the starting and ending position of the characters to be
‘substringed' from the variable. Alternatively, use the up and down
arrows
to increment/decrement the existing values of these
entries.
4 Click beside the Result Variable box.
5 Select or create the variable to receive the extracted contents
and click OK.
6 Click OK
Note: If the ‘To position' is set to "0", this means that all the
characters, starting at the "From" position and up to the end of the
input variable will be copied into the result variable. This is useful when
the length of the input variable varies.
Examples
In this example, the variable [C1] contains three fields of data. This
process extracts the second field from a known position in the variable
and copies its contents into variable [B2].
170