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: toolb...@kestner.de > To: use-livecode@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@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode