Page 1 of 1 1
Topic Options
#118749 - 2004-04-29 12:48 AM Exit ...
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4557
Loc: USA
I'm sure this has been debated before, but I've really found an appreciation for "Exit For". I've been dabbling my fingers in VB lately, and find it much easier to use than the way I'm used to doing it in kix.

Along with "Exit For", I'd also like to suggest "Exit While", and "Exit Do".

Just my two cents.

Top
#118750 - 2004-04-29 01:57 AM Re: Exit ...
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ja, it has been debated...
and I think the debate ended with result:
-no, we can't show a place where it is really needed
-no, we can't show why it should be added

ja, this kinda falls into the category of goto and iif.
it's all up to the coders way of doing things (personal habits)

now, the debate could be should kixtart be free on these issues too.
but after iif() was added (iirc, totally because scriptlogic got it pushed in) these can't be argued.

so, I end my mumble with:
-no, I might not personally like your suggestion
-yes, your suggestion is still good
_________________________
!

download KiXnet

Top
#118751 - 2004-04-29 02:47 AM Re: Exit ...
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4557
Loc: USA
I definately agree with not using Goto, but do you really consider the "Exit For" in the same breath as Goto? Knowing how you like to cut strokes in your code, I would have thought this would have been something more welcome.

I guess I see it as a good way to exit a loop when a certain condition is met... kind of like exiting the script when a error occurs.


Top
#118752 - 2004-04-29 02:31 PM Re: Exit ...
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ja, I know.
but when you go for interrupting the normal circle with exit, you in fact are using goto.
the name is different and the behaviour of exit-for (as an example) can be changed.
instead of leaving the code structure in the stack, it can be flushed but that does not remove the fact that it works just as goto.

anyway, as I've growth in age, I have learned to not dislike goto that much.
and perhaps the fact that ruud uses it too has some impact on my opinion
_________________________
!

download KiXnet

Top
#118753 - 2004-05-07 06:41 PM Re: Exit ...
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
GOTO is kind-of the lst-resort option when anything else fails. However, that would normally imply a skilled coder. And a skilled coder should know about how GOTO/GOSUB/RETURN work and what stacks are used for. The problem is that beginners use GOTO extensively without knowing whta mess they can potentially create.
_________________________
There are two types of vessels, submarines and targets.

Top
#181846 - 2007-10-23 09:21 AM Re: Exit ... [Re: Sealeopard]
Arend_ Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
Exit FOR or any loop for that matter would add significant speed to scripts. For instance using WMI. If you want to check for a specific item in let's say WIN32_Product and you know your item is the first one that is available you want to exit the loop when it is reached, not when it's finished cycling trough all installed products. Sure you can count your way there but who's to say that your specific item is in the first place on the second pc.

So I agree with Allen, I'd love to see Exit For/While statements.

Top
Page 1 of 1 1


Moderator:  Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 507 anonymous users online.
Newest Members
min_seow, Audio, Hoschi, Comet, rrosell
17881 Registered Users

Generated in 0.056 seconds in which 0.025 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org