Re: [LOOP]/[BREAK] bug
This WebDNA talk-list message is from 2000
It keeps the original formatting.
numero = 35553
interpreted = N
texte = Oops, you're right. I spaced on that last example.John PeacockMichael Winston wrote:> > Sure. I have no problem with [BREAK] finishing the iteration before> it bails *or* stopping the loop dead in its tracks mid-iteration (as> long as it's consistent). My concern is the addition of the last> iteration (10) being performed in my example.> > Michael> > >It seems pretty clear to me that [break] exits the loop at the end of> >the current execution; it does not immediately exit. If you want to> >exit a loop prematurely, place the [break] as the last line of the loop,> >not the beginning or middle. You also may need to adjust the test> >around the break, i.e. in your example, if you do not want to exit as> >soon as start=6 (but not process 6) you need to [SHOWIF [INDEX]=5].> >> >John Peacock> >> >Michael Winston wrote:> >>> >> MAC 3.08-4.0xxx PI> >>> >> [BREAK] does funny things depending on where it's placed (mostly, it> >> executes the last iteration of the loop). This one dates back to at> >> least 3.08. Although, it's completely possible that I just don't> >> understand how [BREAK] is supposed to work.> >>> >> Compare:> >>> >> SOURCE:> >> [LOOP start=1&end=10]> >> [INDEX]> >> [INDEX]> >> [SHOWIF [INDEX]=6][BREAK][/SHOWIF]> >> [/LOOP]> >>> >> RESULT:> >> 1 1 2 2 3 3 4 4 5 5 6 6> >>> >> SOURCE:> >> [LOOP start=1&end=10]> >> [INDEX]> >> [SHOWIF [INDEX]=6][BREAK][/SHOWIF]> >> [INDEX]> >> [/LOOP]> >>> >> RESULT:> >> 1 1 2 2 3 3 4 4 5 5 6 10> >>> >> SOURCE:> >> [LOOP start=1&end=10]> >> [SHOWIF [INDEX]=6][BREAK][/SHOWIF]> >> [INDEX]> >> [INDEX]> >> [/LOOP]> >>> >> RESULT:> >> 1 1 2 2 3 3 4 4 5 5 6 6 10 10> >>> >> #############################################################> >> This message is sent to you because you are subscribed to> >> the mailing list
.> >> To unsubscribe, E-mail to: > >> To switch to the DIGEST mode, E-mail to> >>> >> To switch to the INDEX mode, E-mail to> >>> >> Send administrative queries to> >>> >> >#############################################################> >This message is sent to you because you are subscribed to> > the mailing list .> >To unsubscribe, E-mail to: > >To switch to the DIGEST mode, E-mail to> >> >To switch to the INDEX mode, E-mail to> >> >Send administrative queries to > > #############################################################> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > To switch to the INDEX mode, E-mail to > Send administrative queries to #############################################################This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to To switch to the INDEX mode, E-mail to Send administrative queries to
Associated Messages, from the most recent to the oldest:
Oops, you're right. I spaced on that last example.John PeacockMichael Winston wrote:> > Sure. I have no problem with [BREAK] finishing the iteration before> it bails *or* stopping the loop dead in its tracks mid-iteration (as> long as it's consistent). My concern is the addition of the last> iteration (10) being performed in my example.> > Michael> > >It seems pretty clear to me that [break] exits the loop at the end of> >the current execution; it does not immediately exit. If you want to> >exit a loop prematurely, place the [break] as the last line of the loop,> >not the beginning or middle. You also may need to adjust the test> >around the break, i.e. in your example, if you do not want to exit as> >soon as start=6 (but not process 6) you need to [SHOWIF [INDEX]=5].> >> >John Peacock> >> >Michael Winston wrote:> >>> >> MAC 3.08-4.0xxx PI> >>> >> [BREAK] does funny things depending on where it's placed (mostly, it> >> executes the last iteration of the loop). This one dates back to at> >> least 3.08. Although, it's completely possible that I just don't> >> understand how [BREAK] is supposed to work.> >>> >> Compare:> >>> >> SOURCE:> >> [LOOP start=1&end=10]> >> [INDEX]> >> [INDEX]> >> [SHOWIF [INDEX]=6][BREAK][/SHOWIF]> >> [/LOOP]> >>> >> RESULT:> >> 1 1 2 2 3 3 4 4 5 5 6 6> >>> >> SOURCE:> >> [LOOP start=1&end=10]> >> [INDEX]> >> [SHOWIF [INDEX]=6][BREAK][/SHOWIF]> >> [INDEX]> >> [/LOOP]> >>> >> RESULT:> >> 1 1 2 2 3 3 4 4 5 5 6 10> >>> >> SOURCE:> >> [LOOP start=1&end=10]> >> [SHOWIF [INDEX]=6][BREAK][/SHOWIF]> >> [INDEX]> >> [INDEX]> >> [/LOOP]> >>> >> RESULT:> >> 1 1 2 2 3 3 4 4 5 5 6 6 10 10> >>> >> #############################################################> >> This message is sent to you because you are subscribed to> >> the mailing list .> >> To unsubscribe, E-mail to: > >> To switch to the DIGEST mode, E-mail to> >>> >> To switch to the INDEX mode, E-mail to> >>> >> Send administrative queries to> >>> >> >#############################################################> >This message is sent to you because you are subscribed to> > the mailing list .> >To unsubscribe, E-mail to: > >To switch to the DIGEST mode, E-mail to> >> >To switch to the INDEX mode, E-mail to> >> >Send administrative queries to > > #############################################################> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > To switch to the INDEX mode, E-mail to > Send administrative queries to #############################################################This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to To switch to the INDEX mode, E-mail to Send administrative queries to
John Peacock
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
[SHOWIF]s and empty arguments (1997)
WebCat2b15MacPlugin - showing [math] (1997)
Expert tech support -- a fast and simple solution (long) ... (2000)
table max? (2001)
Quit revisited (1997)
incrementing a counter remotely? (1999)
Postdata expired from cache (2004)
Help! WebCat2 bug (1997)
writing db to disk (1997)
WebCatalog/WebMerchant 2.1 (1998)
Webmessage Hyperboard (1998)
WebCatalog Mac 2.1b3 (1997)
[WebDNA] Some code inside a large loops fail ... but why? (2010)
Help formatting search results w/ table (1997)
[WebDNA] Google Cloud (2014)
Nested tags count question (1997)
[WebDNA] [OT] Kickstarter feedback please? (2015)
Upgrading old WebCat Database Files (1997)
WebDNA Trouble... (1999)
SiteEditPro (1996)