Stylistic question.

Alex Tweedly alex at tweedly.net
Sun Jun 19 16:32:46 EDT 2022


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.




More information about the use-livecode mailing list