Switch, Case and wild-cards?

kee nethery kee at kagi.com
Thu Dec 27 17:33:21 EST 2012


switch 
   case 1
      stuff
      break
   case 2
…
   case 500
      stuff
      break
   default
      stuff CASE for ALL excluded cases
      break
end switch



On Dec 27, 2012, at 2:26 PM, Richmond <richmondmathewson at gmail.com> wrote:

> So there I am up to my thighs in a switch statement with a good 500 odd cases . . .
> 
> . . . and, like treacle, I find myself getting bogged down . . .
> 
> e.g:
> 
>   switch the text of fld "TEKST"
>      case 1
>        --do something--
>      break
>      case 2
>        --do something else--
>      break
>   end switch
> 
> is all very charming and straightforward.
> 
> But, suppose I would like to include a CASE for ALL excluded cases (hope you are following me here):
> 
> e.g:
> 
>   switch the text of fld "TEKST"
>      case 1
>        --do something--
>      break
>      case 2
>        --do something else--
>      break
>      case "any other value in fld "TEKST" '
>        --run around babbling about purple bananas--
>      break
>   end switch
> 
> has anyone any idea how to effect this sort of situation WITHOUT using a bunch of nested IF . . .  THEN statements instead???
> 
> Richmond.
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list