Post Reply 
STRINGFROMID and gradians
09-21-2018, 05:47 PM (This post was last modified: 09-22-2018 07:28 AM by StephenG1CMZ.)
Post: #24
RE: STRINGFROMID and gradians
Maybe I'm wrong - I don't use EXIT often.

But
Code:

For i from 1 to 9
For j from 1 to 9
 EXIT(2)
End
End
Here:
Msgbox("ok")
I would expect to reach Here OK.

Now surround that working code with an additional for loop:

For newloop from 1 to 9
For i from 1 to 9
For j from 1 to 9
EXIT(2)
End
End
MSGBOX("are we there yet? Why not")
End
Here: MSGBOX("ok we have failed")

Simply surrounding previously working code with a trival for loop breaks the working code, unless you hunt through all your code fixing exits (in this example 1 extra for means changing 1 exit(2) to exit(3), I think, though I haven't debugged all the code to be certain).

Now, replace exit(2) or exit (3) with goto here:

Now, you don't have to edit all those exits every time you write a for loop.
Your code will reach here whether you have two for loops, or have written a third ok.

It could be I have misunderstood how EXIT works, but a GOTO looks like MUCH less effort.
Update: In PPL its BREAK or CONTINUE, apparrently, not EXIT - Thanks Cyberangel.

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: STRINGFROMID and gradians - roadrunner - 09-18-2018, 03:46 PM
RE: STRINGFROMID and gradians - roadrunner - 09-18-2018, 04:22 PM
RE: STRINGFROMID and gradians - CyberAngel - 09-18-2018, 04:39 PM
RE: STRINGFROMID and gradians - roadrunner - 09-18-2018, 05:09 PM
RE: STRINGFROMID and gradians - Tyann - 09-19-2018, 05:02 AM
RE: STRINGFROMID and gradians - CyberAngel - 09-19-2018, 03:53 PM
RE: STRINGFROMID and gradians - CyberAngel - 09-19-2018, 04:10 PM
RE: STRINGFROMID and gradians - toml_12953 - 09-20-2018, 05:52 PM
RE: STRINGFROMID and gradians - CyberAngel - 09-20-2018, 05:58 PM
RE: STRINGFROMID and gradians - CyberAngel - 09-21-2018, 04:49 PM
RE: STRINGFROMID and gradians - StephenG1CMZ - 09-21-2018 05:47 PM
RE: STRINGFROMID and gradians - Tyann - 09-22-2018, 02:37 PM
RE: STRINGFROMID and gradians - CyberAngel - 09-21-2018, 09:04 PM



User(s) browsing this thread: 1 Guest(s)