Chapter 5 : Using Processes

5.8.8.Variable Substring

General introduction

Variable Substring

Examples

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.

To remove characters from a variable, proceed as follows:

1Add the process Variable Substring to your label program

2In the Input Value box, select the variable from which you want to ‘substring' a certain number of characters.

3In 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.

5Select or create the variable to receive the extracted contents and click OK.

6Click 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.

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].

www.mcl-collection.com

October 2007

Page 170

Copyright © 2007 • MCL Technologies • All Rights Reserved

 

 

Page 170
Image 170
Datamax v1.1x user manual General introduction Variable Substring Examples