One reason would be if you were trying to use behaviors so you could manage 
your code with a repository like Git.  This would greatly reduce the number of 
behavior scripts that you would create.  One app that work on has the code in 
the stack’s behavior script.

Sent from my iPhone

> On Jun 19, 2022, at 4:33 PM, Alex Tweedly via use-livecode 
> <use-livecode@lists.runrev.com> wrote:
> 
> I've noticed that in a lot of the example code I've seen recently, there's a 
> bit of a common pattern.
> 
> In the card script, there will be code like
> 
> on mouseUp
>   switch the short name of the target
>     case "first"
>         doCommandFirst
>         break
>     case "another"
>         doCommandAnother
>         break
>     case "lastnotleast"
>         doCommandlastnotleast
>         break
>   end switch
> end mouseUp
> 
> I've seen this in examples from Livecloud, Appli, the WebApp example from 
> Steven/Michael, and a few other places.
> 
> I would generally have put this code in each button (or other control) 
> directly, and I'm wondering whether there are advantages or preferences for 
> one of those versus the other.
> 
> Thanks for any opinions,
> 
> Alex.
> 
> 
> _______________________________________________
> 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

Reply via email to