Datamax v1.1x Printer User Manual


 
Copyright © 2007 • MCL Technologies • All Rights Reserved
www.mcl-collection.com
Chapter 5 : Using Processes
5.2.2. Control and Branch
General introduction The Control and Branch process allows you to compare the contents of
a variable against a specific pattern.
Depending on the result of the check, the program will branch to the
defined destination—a screen, label or code line.
Control and Branch To compare a character pattern with the contents of a variable, proceed
as follows:
1 Add the process Control & Branch to your label program
2 In the If Value box, select the variable for which you want to
compare the character pattern
3 In the Follows Pattern box, select the pattern. This pattern can
consist of:
The Letters A to Z to specify a specific letter
The numbers 0 to 9 to specify a specific number
The dollar sign ($) stands for `any numeric character'
The double quotes (") stand for `any alphabetic character'
The underscore (_) stands for any alphanumeric character
The interrogation mark (?) stands for `ignore'
The asterisk (*) stands for `ignore the rest of the input from
this point on'
4 In the Then go to box, select the action to be performed or the
screen to go to if the test result is true.
5 In the Else go to box, select the action to be performed or the
screen to go to if the test result is false
6 Click OK
Example The following variable contents give the following results:
If,
Follows Pattern = B$$"?4*
Then,
Variable Contents
Result
B21C14BB34
A21C14BB34
B999A4
True
False - first character not "B"
False - fourth character not alphabetic
If the contents of the variable [A5] Product Description satisfy the
pattern, then the application will continue. Otherwise, it will branch to
Screen 2.
October 2007 Page
137