Chapter 5 : Using Processes

5.2.1.Case and Branch

General introduction

The Case & Branch process allows you to compare the value of a

 

variable input with up to six other variables or values.

 

The Case and Branch command will check for equality only.

 

As soon as an equality is found, the process branches to the defined

 

destination (Label, or screen ...)

 

If all the comparisons are false, the action or screen in the Otherwise

 

Goto list is performed.

 

 

Case and Branch

To compare a variable or value with other variables or values, proceed

 

as follows:

 

1

Add the process Case & Branch to your label program

 

2

In the Case Value box, enter the value or select the variable you

 

3

want to compare.

 

In the Equal boxes, enter the values or select the variables you

 

 

want to compare against the value or variable selected in the Case

 

4

Value box.

 

In the corresponding Goto boxes, select the action to be

 

5

performed or the screen to go to if the test results are true.

 

In the Otherwise Goto box, select the action to be performed or

 

6

the screen to go to if the test results are false.

 

Click OK

Example

In this example, the user is prompted to enter a product type. The Case

 

and Branch process then compares the entered product type with

 

predefined values. These values can be constants or variables. This

 

example shows both. The contents of [A8] Product Type are compared

 

against the value found in variable [A9] Product Option and against the

 

constant HARDWARE.

When a match is found, the label program branches to a screen according to the product type entered. If there is no match, the program goes to screen 2. If the product type entered matches the contents of [A9] Product Option, the program goes to screen 3. If the product type entered is HARDWARE, the program goes to screen 4. The program flow and process statement are shown below.

October 2007

Page 135

www.mcl-collection.com

Copyright © 2007 • MCL Technologies • All Rights Reserved

 

 

Page 135
Image 135
Datamax v1.1x user manual Case and Branch