Skip to content
angerangel edited this page Mar 19, 2013 · 1 revision

USAGE

   SWITCH value cases /default case /all

DESCRIPTION

Selects a choice and evaluates the block that follows it.

SWITCH is a native value.

ARGUMENTS

  • value -- Target value
  • cases -- Block of cases to check (block!)

REFINEMENTS

  • /default
    • case -- Default case if no others found
  • /all -- Evaluate all matches (not just first one)

#SOURCE

switch: make native! [  [
    {Selects a choice and evaluates the block that follows it.}
    value "Target value"
    cases [block!] "Block of cases to check"
    /default case "Default case if no others found"
    /all "Evaluate all matches (not just first one)"
] ]
Clone this wiki locally