Chapter 5 : Using Processes

5.8.6.Variable Position

General introduction

The Variable Position process allows you to search for and determine

 

the position of a specific character or string of characters inside a

 

variable.

 

 

The process gives the position of the first character of the string inside

 

the variable, and the position of the first character after the end of the

 

string.

 

 

 

Variable Position

To search for and determine the position of a character(s) inside a

 

variable, proceed as follows:

 

1

Add the process Variable Position to your label program

 

2

Select the input variable

 

3

Enter the character or string of characters to search for. This can

 

4

also be a variable if the search criteria is contained in a variable

 

Select the occurrence of the criteria:

 

 

ƒ First occurrence in the input variable after the “From Position”,

 

5

ƒ Last occurrence in the input variable before the “To Position”,

 

Specific occurrence between the “From Position” and “To

 

6

Positions”

 

Enter values for the From Position and To Position. These

 

 

entries define the area inside the input variable where the search

 

 

must start and stop. A zero for the “To Position” means until the

 

 

end of the variable in the case where a variable varies in length.

 

7

Click

beside the Result Variable box.

 

8

Select or create the variable to receive the position of the first

 

 

character of the contents for which you are searching and click

 

 

OK.

 

 

9

Click

beside the Result Var [End+1] box.

 

10

Select or create a new variable to receive the position+1 of the

 

 

last character of the contents for which you are searching and

 

11

click OK.

 

 

Click OK

 

Examples

In this example, the variable [C1] is searched for a match for the word

 

“check”. When it is found for the first time, its starting position in

 

variable [C1] is saved in variable [C2]. The ending position +1 of the

 

first occurrence of “check” is saved in variable [C3].

www.mcl-collection.com

October 2007

Page 168

Copyright © 2007 • MCL Technologies • All Rights Reserved

 

 

Page 168
Image 168
Datamax v1.1x user manual Variable Position, Beside the Result Variable box