I have not used the Continue or Break control structure very often,
probably because I was taught that methods, functions, loops, etc
should have one exit (whenever possible).
That is kind of like the "Third Normal form" in relational theory -
nice idea but sometimes not practical.
"Nice idea but sometimes not practical" -- exactly. I'm not sure if it
is even a nice idea. If anything break and continue make the control
flow clearer. Using flag variables and superfluous if/end if tests to
skip sections of code obscures the intent.
for ($i; 1; 100)
if (foo($i))
$i := 999 // is this really clear?
else
bar
end if
end for
4D is the only language that I know of that uses a crazy idiom like
the one above where you have to set the loop variable to break out of
the loop.
The other reason is that I seem to have periodic problem with it in
for each loops.
I haven't heard any other reports of this, but then I doubt many
people are using continue. If you can come up with a reproducible
example I will certainly look into it.
Kind regards,
Aparajita
www.aparajitaworld.com
"If you dare to fail, you are bound to succeed."
- Sri Chinmoy | www.srichinmoy.org
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/