[REBOL] fun with for loops
From: chalz:earthlink at: 1-Aug-2002 22:24
Howdy folks. Got a bit of a difficulty here. Say I'm evaluating a for
loop, like reading lines of text from a file. At the beginning of my for loop,
I have it check to see if the line is commented, blank, or neither. If it's
commented or blank, I want it to just skip to the next iteration of the for
loop; however, if it's neither, let it keep going. I would prefer to do this
with a simple if [] as opposed to a heavy either [][]... 'break' doesn't do
what I need - it kills the for loop entirely, instead of skipping to the next
iteration. If I use either [][], I have to do:
either condition? [
if true do this
][
if false
do these
next 20 lines
all indented
with more indentation
yet to come
very long lines
]
You follow me? It's a coding habit I've picked up from another language.
Thanks folks.
--Charles