Re: New switch/case idea

new topic     » goto parent     » topic index » view thread      » older message » newer message
Fernando said...

Thanks Jeremy, but that's strange.

Does that mean that break without label inside an if-then statement is useless ?

Yes, I will wait for Matt to give some input. I do know it can be handy sometimes in nested if's. Maybe we should recosider how it works... Here's how it would work in multiple if's

procedure hi(integer x) 
    if x > 0 label "top" then 
        x += 10 
        if x > 15 then 
            break "top" 
        end if 
 
        x += 20 
    end if 
    ? x 
end procedure 
 
hi(8) -- 18 
hi(1) -- 31 

Jeremy

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

Search



Quick Links

User menu

Not signed in.

Misc Menu