Re: case and foreach

new topic     » goto parent     » topic index » view thread      » older message » newer message

> 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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu