I've had to do perl coding in the past and, in most regards, Letoscript is very perl-like. The way lists and hashes are denoted, the chained conditional execution, the way subroutines are defined, etc. But, for whatever reason,
last
and
next
are not the Letoscript analogs to NWScript's
break
and
continue
. There may be something odd in play here, since using those keywords also does not cause Letoscript to give an error... It's possible there was a plan to implement them that never was completed.
acomputerdood, I can figure out how to conditionally skip iterations in the loop. My goal was to save compute cycles by actually ending the loop early when possible. For example, if I want to grab only the first instance of an object in the module that meets certain criterion and then do something with it, it will save a lot of time if the code doesn't cycle through all possible objects.
For present purposes, I am pretty sure Letoscript will do what I want by using a
while
loop and using
pop
to get each loop iterable, then setting a variable that fails the
while
test when the criterion is met. It's not as nice a method as using
break
, but it will do. Unfortunately, implementing
continue
that way is somewhat messy, as I think I would need a cascaded set of
if
blocks in the loop. :-(