Re: Case Construct

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

Michael J. Sabal wrote:
> 
> Forgive me for asking, but what benefit does case offer over elsif other than
> saving a handful of keystrokes?

A C-style case statement also offers fall through:
switch foo do
    case bar:
        -- do stuff
        exit
    case special_baz
        -- do stuff, then continue with normal baz

    case baz
        -- do baz stuff
        exit

    default
        -- do stuff
end switch

Matt

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

Search



Quick Links

User menu

Not signed in.

Misc Menu