Controlling program flow and case statements 
Author Message
 Controlling program flow and case statements

Hey all, I was wondering, I if I have 40 nested case statements and I
want the program to close after they are all done, is it sufficient to
wire the "?" for both true and false of the outermost case to the
close routine in order to guarantee that all of them will execute? Or
is there an even better way using data flow methods?

-Dobbs



Mon, 08 Dec 2003 03:15:59 GMT  
 Controlling program flow and case statements
A simple and sure way is to use a Sequence structure - 1st sequence is
the cases, 2nd sequence is the exit.
Doug


Mon, 08 Dec 2003 03:31:17 GMT  
 Controlling program flow and case statements
imho, 40 nested case statements is too many by about a factor of 10. I
think anything like this becomes impossible to maintain. State
machines can be used much more effectively. If you use strings or
enums as inputs to drive the state machine, they are also easier to
document.


Mon, 08 Dec 2003 21:29:31 GMT  
 Controlling program flow and case statements
Oh I agree. I was just coming up with an extreme example :)

Thanks,
-Dobbs



Mon, 08 Dec 2003 23:27:14 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Program Flow Control

2. program flow control

3. Program Flow Control Structures

4. ? Tk program flow control

5. case statement flipflop statement

6. difference if statement with case statement?

7. Smalltalk syntax and flow control

8. PROPOSAL: New Control Flow Words

9. RFI: Control-flow Stack

10. Control-flow stack which may not exist

11. Q. WHAT is the Control Flow Stack?

12. Where is the Control Flow Stack?

 

 
Powered by phpBB® Forum Software