Rebol Programming/case

From Wikibooks, open books for an open world
< Rebol Programming
Jump to navigation Jump to search

USAGE:[edit | edit source]

CASE block /all 

DESCRIPTION:[edit | edit source]

Evaluates each condition, and when true, evaluates what follows it.

CASE is a native value.

ARGUMENTS[edit | edit source]

  • block -- Block of cases (conditions followed by values) (Type: block)

REFINEMENTS[edit | edit source]

  • /all -- Evaluate all cases (do not stop at first true case)

SOURCE CODE[edit | edit source]

case: native[
    {Evaluates each condition, and when true, evaluates what follows it.} 
    block [block!] "Block of cases (conditions followed by values)" 
    /all {Evaluate all cases (do not stop at first true case)}
]