Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
YarSnez
23
Years of Service
User Offline
Joined: 9th Apr 2003
Location:
Posted: 13th Aug 2003 13:22
I see in the bug reporting forum that FOR NEXT loops have had their safety code removed making them much faster at the cost of not being able to ESC out of them. This is fine, fast loops are a good thing. I see that the other types of loop, such as WHILE ENDWHILE still have the safety code in place. Just a suggestion, but it would be nice if there were a compiler option to have this safety code enabled or disabled. That way all loops could be nice and fast if wanted or people could have the option of being able to ESC out of them for test purposes etc.
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 13th Aug 2003 14:44
Are you talking about the "EXIT" statement? If so, I wasn't aware they disabled that function from working inside FOR LOOPs, but if they did I'd say it's a good thing. FOR LOOPs should only be used when the exit condition is certain. If you ever want to break out of the loop mid way through, you should be using a repeat until or while loop. I know a lot of people don't do this, but it's good programming practice.

Insiiiiiiiiiiiiiiiiiiiiiiiide!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Aug 2003 15:11
No, he's talking about the standard 'check for the escape key and other stuff' that's inserted regularly throughout the code, except for within for/next loops.
YarSnez
23
Years of Service
User Offline
Joined: 9th Apr 2003
Location:
Posted: 13th Aug 2003 15:13
Yes I am, and apparently people have noticed that hitting the ESC key no longer breaks out of the FOR NEXT loops. I would hope that EXIT still works though as sometimes it's desirable to exit prematurely for performance reasons. I think that all looping constructs should have max performance though, or at least an option for this, hence my suggestion.
DidRocks
23
Years of Service
User Offline
Joined: 28th May 2003
Location: France
Posted: 13th Aug 2003 15:18
I think this could be a great thing. Just an option to checking to enable/disable safety code in boucle. So, everybody have choice ^^
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Aug 2003 15:26
There are exceptions though ...



The check is only disabled locally within the for/next loop.

Personally, I'd prefer that checking was re-enabled for for/next loops (and so on globally by default), but with the addition of two new compiler directives to allow the checking to be disabled/enabled at will.

#checking on
#checking off

... or something similar.
YarSnez
23
Years of Service
User Offline
Joined: 9th Apr 2003
Location:
Posted: 13th Aug 2003 15:30
Sounds good to me. I like the idea of the safe mode on by default. That way we have to specifically state we want the faster looping option and therefore more aware of having to do our own checking for ESC key if we want it.
EddieRay
23
Years of Service
User Offline
Joined: 28th Feb 2003
Location: USA
Posted: 13th Aug 2003 19:25
As it stands now, would checking be enabled inside a "WHILE...ENDWHILE" loop that is nested inside a "FOR...NEXT" loop?

Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 13th Aug 2003 19:28
Yep.

Kevin Picone
Play Basic - Visible Worlds - Kyruss II
[url]www.underwaredesign.com[/url]

Login to post a reply

Server time is: 2026-07-22 20:17:55
Your offset time is: 2026-07-22 20:17:55