Chapter 5 : Using Processes

5.4. File Search

 

 

 

General introduction

The File Search command allows you to read the fields of a record in a

 

file and assign their contents to variables. The file records are searched

 

using a value you provide as the lookup key.

 

You can search for a record in a file using a lookup key for either the

 

first or the second field in the file.

 

 

 

File Search

To read fields from a file and store them into variables, proceed as

 

follows:

 

1 Add the process File Search to your label program.

The File Lookup dialogue box is displayed as shown here

2In the Local File Name box, select the file you want to search.

The fields of your file records are listed in the Fields column of the table.

You can search the file using a lookup key for either the first or second field in the records. Field 1 represents a lookup key for the first field in the file; Field 2 represents a lookup key for the second field in the file.

If your lookup file is unsorted, you may use both the first and second fields in your search. If your lookup file is sorted by the first field, you may use only the first field in your search. If your lookup file is sorted by the first and second fields, you may use both the first and second fields in your search.

3In the Field 1 box, type the value or select a variable to use as your first field lookup key

4In the Field 2 box, if needed, type the value or select a variable to use as your second field lookup key

Once the file is searched and a match is found, you can copy the contents of the record into variables.

5In the Fields column of the table, consider which fields (at least one) you want to assign to an existing or new variable.

6 Click

to open the Variables dialogue box.

7Select or create the Result variable to which you want to assign the corresponding field contents.

8In the If record not found Goto box, select the action to perform or the screen to go to if the record is not found.

October 2007

Page 147

www.mcl-collection.com

Copyright © 2007 • MCL Technologies • All Rights Reserved

 

 

Page 147
Image 147
Datamax v1.1x user manual File Search