Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Absolute need of goto 4 correct functioning of loop routine.
#5
I did make note of your optimization argument, above. Fortunately, I've never had the headache of writing a program that suffered from speed issues to the point that including a GOTO statement would significantly improve speed (but no other refactoring technique could). But then, I haven't written very many compound/nested loop/command-heavy programs. I've always found another way. So I'm not really qualified to comment on using GOTO for optimization.

As far as EXIT FOR: Technically, it transfers program flow ahead to the line immediately following the first NEXT command it encounters. So if you can stack your NEXT statements, you can EXIT FOR them as a block.

If you are processing commands in between your NEXT statements, then you obviously can't stack them, and therefore you can't EXIT them as a block. In this instance, I'd either:

1. Set the conditional variable in the inner-most loop, and have it calculate its way out, or

2. Block logically-related inner loops (ones with identical exitcondition) into a SUB, and call the SUB from the outer loop (which we don't want to kick out of). Then you can terminate the SUB to cease internal loops, and program flow will continue on with the outer loop.

*peace*

Meg.
Reply


Messages In This Thread
Absolute need of goto 4 correct functioning of loop routine. - by Meg - 02-02-2005, 08:18 PM
Need more - by Mac - 02-03-2005, 12:50 AM
Mea culpa - by Mac - 02-03-2005, 01:57 AM
Using goto - by Mango - 02-12-2005, 04:45 PM
Not required though - by Mac - 02-12-2005, 07:55 PM
Got UnLazy - by Mac - 02-12-2005, 11:12 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)