Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: "else" with 'switch

From: al:bri:xtra at: 18-Feb-2001 9:27

Ryan wrote:
> I'm trying to develop else-like logic using 'switch...
What's wrong with /Default for 'Switch?
>> help switch
USAGE: SWITCH value cases /default case DESCRIPTION: Selects a choice and evaluates what follows it. SWITCH is a function value. ARGUMENTS: value -- Value to search for. (Type: any) cases -- Block of cases to search. (Type: block) REFINEMENTS: /default case -- Default case if no others are found. (Type: any) Like this: switch/default option [ "a" [print "a"] "b" [print "b"] ][ print "something else" ] Andrew Martin ICQ: 26227169