angerangel edited this page Jan 2, 2013 · 1 revision

Table of Contents

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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.