Hi Karen

I've seen this used in after prompt subroutines, where there were literally
multiple hundreds of Subroutines to execute, based on the attr number.  In
that case it's cleaner, and might I add easier, than HUNDREDS of lines of
code that just say

CASE ATTR = 1
  GOSUB 1
<SNIP 400 LINES OF CODE>
CASE ATTR = 202
  GOSUB 202
<SNIP ANOTHER 200 LINES OF CODE>
CASE ATTR = 302
  GOSUB 302

Granted, you end up with multiple ON ...... GOSUB statements because there
is a limit to how many GOSUBs you can have on one statement, but to have few
statements instead of 600+ lines of code *just for the control statements*
is 'better', imho.

Of course one could conceivably write a small program to generate the case
statements, and you wouldn't have all the typing to do, but I still think
the ON statement has it's place.

fwiw....

Allen
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Karen Bessel

ON GOSUB......Baddddddddddddd. Bill, that is a bad coding practice -
don't go there.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Manu Fernandes
Try this

ON index('AB2',Ans,1) GOSUB Check.A, Check.B, Check.B

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

Reply via email to