Re: case and foreach
- Posted by Greg Haberek <ghaberek at gmail.com> Mar 31, 2005
- 549 views
> I've thought about foreach and I don't really think that it needs to be added > to the language because it can be done with a function or procedure. > One problem with a built-in foreach -- does it only iterate the top level of a > sequence or does it dig down through sub sequences? I think that is one reason > to leave it as a procedure or function. What I really need is 'next' because I'm sick and tired of putting a bunch of code in an 'if' statement.
for x = 1 to 50 do if some_condition then -- do a lot of code here end if end for -- OR -- for x = 1 to 50 do if not some_condition then -- skip to next x next end if -- do a lot of code here (1-level down) end for
'select/case' would be nice, too. :) ~Greg