Just note that this would execute the <twisting little logic> that I'm
*assuming* the second exit was meant to avoid. I'm also assuming that
somewhere in the logic either G or H is modified otherwise you should test
them first and avoid the loops altogether. :) (niggly point - the use of
exit makes your use of a2.done redundant).

To answer the original question, I don't usually use exit, but I would
expect the second one to be skipped as that is exactly what the first one is
meant to do!

hth
Colin


-----Original Message-----
From: Lunt, Bruce
Sent: April 19, 2012 2:50 PM
To: 'U2 Users List'
Subject: Re: [U2] EXIT ; EXIT inside a loop

You could add logic to the For Next as in:


A1.DONE = FALSE
A2.DONE = FALSE

FOR A1 = 1 TO X UNTIL A1.DONE

  FOR A2 = 1 TO Y UNTIL A2.DONE

    <little twisted logic>

    IF G = H THEN A1.DONE = TRUE; A2.DONE = TRUE; EXIT

    <twisted little logic>

  NEXT A2

  <twisting little logic>

NEXT A1

<little twisting logic>

The question is, if G = H, will the two EXIT commands drop out of both
loops, skipping BOTH <twisted little logic> and <twisting little logic>, and
resume execution at <little twisting logic> ?


PLOUGH

Sincerely,

David Laansma


_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to