Focal Point
CASE loops in webfocus

This topic can be found at:
http://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4061077331

April 05, 2004, 05:30 PM
<pushpa_koneri>
CASE loops in webfocus
Hey Guys
Do we have CASE LOOP or anything similar to
case loop in webfocus. I need to
differentiate between 30 different variables
and according perform seperate operations.
IF-THEN-GOTO doesn't appeal to me in htis
situation so was wondering if I can get
something similar to CASE LOOP.

Thanks in advance for your help ... :-)
April 05, 2004, 07:13 PM
<WFUser>
Try -REPEAT
April 05, 2004, 07:18 PM
suzy_smith
You could use a branch table based on the incoming value, or on a DECODEd value.

For example, the direct method, where the value of &PARMNAME could be RED or GREEN or BLUE, you can say:

-GOTO &PARMNAME

where you have branch labels set up in your code.

-RED
(do code for &PARMNAME=RED)
-GOTO DONE
-*
-GREEN
(do code for &PARMNAME=GREEN)
-GOTO DONE
-*
-BLUE
(do code for &PARMNAME=BLUE)
-GOTO DONE

You would also want to test to make sure that the value of &PARMNAME is one of the valid values. This could be done via a list in a HOLD file (or flat file) or using a DECODE list.
April 05, 2004, 11:32 PM
susannah
CASE logic is used in MODIFY:
here's the url
http://documentation.informationbuilders.com/masterinde...ifydatasources11.htm
or..
just go to Knowledge Base Search and put in
CASE logic
and take the first response you get back.