Chapter 5 : Using Processes

5.8.7.Variable Search and Replace

General introduction

The Variable Search and Replace process allows you to search for a

 

specific character or a string of characters inside a variable and if found,

 

the string will be replaced by another character or string of characters.

 

The command parameters include the:

 

 

Starting position of the search

 

 

Selection of the "First", "Last" or a specific occurrence inside the

 

 

variable.

 

 

Variable Search and

To search and replace a character or a string of characters inside a

Replace

variable, proceed as follows:

 

 

1

Add the process Variable Search and Replace to your label

 

2

program

 

In the Input Value box, select the input variable to be searched.

 

3

In the Search Value box, the character or string of characters to

 

 

be used in the search. This can also be a variable if the search

 

4

criteria is contained in a variable.

 

In the Replace Value box, type the character or string of

 

 

characters or select a variable containing the character(s) to be

 

5

used as the replacement value.

 

Select the occurrence of the criteria:

 

 

ƒ first occurrence in the input variable after the "From Position”,

 

 

ƒ last occurrence in the input variable before the "To Position”,

 

 

ƒ specific occurrence between the "From Position" and "To

 

6

Position”

 

To search for a specific occurrence, simply type the occurrence

 

7

number in the Occurrence box.

 

Select the From Position and To Position. These entries define

 

 

the area within the input variable where the search starts and

 

 

stops.

8 Click

beside the Result Variable box.

9Select or create the variable to receive the replaced contents and click OK.

10Click OK

Examples

In this example, if the following Variable Search and Replace process is

 

run with:

 

[B4] = 001234.569

 

Then,

 

[B9] = 003214.569

October 2007

Page 169

www.mcl-collection.com

Copyright © 2007 • MCL Technologies • All Rights Reserved

 

 

Page 169
Image 169
Datamax v1.1x user manual Variable Search and Replace