The first structure emphasizes program flow based on Ans and is very
readable.  The second structure show program branching and is also readable.
Another approach might be thus:

  Alpha.Cmds        = ""
  Alpha.Cmds<1, -1> = "A"
  Beta.Cmds         = ""
  Beta.Cmds<1, -1>  = "B"
  Beta.Cmds<1, -1>  = "2"
...
  begin case
        case Ans matches Alpha.Cmds  ;  gosub Check.A
        case Ans matches Beta.Cmds   ;  gosub Check.B   
  end   case

David A. Green
DAG Consulting
480.813.1725

-----Original Message-----
 How can this structure be cleaned-up?

  begin case
        case Ans = 'A'  ;  gosub Check.A
        case Ans = 'B'  ;  gosub Check.B   
        case Ans = '2'  ;  gosub Check.B  
  end   case

The following is more difficult to read.

  begin case
        case Ans = 'A'               ;  gosub Check.A
        case Ans = 'B' or Ans = '2'  ;  gosub Check.B   
  end   case

I would like something like...

  begin case
        case Ans = 'A'  ;  gosub Check.A
        case Ans = 'B'    
        case Ans = '2'  ;  gosub Check.B  
  end   case

so that the "gosub Check.B" command is not repeated.  I have tried a few
alternatives without a victory.

Suggestions would be appreciated.

--Bill
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to