working method?

Sarah Reichelt sarah.reichelt at gmail.com
Thu Oct 27 03:11:09 EDT 2005


> But, I try and never script a mouseUp handler more than a few lines. For
> instance, I might have the script of button "Delete Row":
>
> on mouseUp
>    put altSelectedLine() into tLineNum
>    deleteRow tLineNum
> end mouseUp
>
> Then I'd have also in the same button script:
>
> function altSelectedLine

... snip.

This is great advice here for several reasons.  Keeping the mouseUp
handler short and using sub-handlers makes it very easy to read. Also,
if you ever have to send a message to the button, it is much clearer
if your script says:
  send "deleteRow" to tbn "Delete"
than if it says:
  send "mouseUp' to btn "Delete"

It is easier to read and much easier to track in the list of pendingMessages.

However one of the things to emerge from this thread is that there are
widely differeing methods in use. They are all workable, so it's
really a matter of adopting a consistent approach that works for you,
so that the handlers are where you would expect them to be when you
come back to a project.

Cheers,
Sarah



More information about the use-livecode mailing list