how to shorten a case structure?
John Dixon
dixonja at hotmail.co.uk
Mon Jun 6 08:21:37 EDT 2011
on mouseUp
put "foo" & random(3) into myVar
put (last char of myVar) into whichOne
switch whichOne
case whichOne
put "myFunction" && whichOne
break
end switch
end mouseUp
Maybe ?....
> From: toolbook at kestner.de
> To: use-livecode at lists.runrev.com
> Subject: how to shorten a case structure?
> Date: Mon, 6 Jun 2011 14:14:12 +0200
>
> Hi,
>
> I just don't know if I don't see the obvious, or if this is the only way to
> go.
>
> I have a switch structure, which looks in a shot form like this:
>
> Switch myVar
>
> case "foo1"
>
> myFunction 1
>
> case "foo2"
>
> myFunction 2
>
> etc.
>
>
>
> very regular 1 to 1, 2 to 2. Is there a way, with "do." or something like
> that, to shorten it up to one single case with a variable?
>
> Thanks
>
> Tiemo
>
>
>
>
>
>
>
> _______________________________________________
> 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