I am looking to eliminate the number of message handlers.
The example I show here is used because of the similar functions of the returnInField and enterInField handlers
In psuedo terms, is there a way to instruct enterInField to "see returnInField above"
on returnInField
doThis
doThat
doSomethingElse
end returnInField
on enterInField
doThis
doThat
doSomethingElse
end enterInField
Consolidate Messages
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Consolidate Messages
You can go to making another command that you maintain only once, and refer to it whenever, as inYou can go further with this approach and make generic modular handlers that you can pass parameters and have them react in different ways according to the way they were called, but still maintain only one code segment.
Code: Select all
on returnInField
doEnterOrReturnInFieldHandler
end returnInField
on enterInField
doEnterOrReturnInFieldHandler
end enterInField
on doEnterOrReturnInFieldHandler
doThis
doThat
doSomethingElse
end doEnterOrReturnInFieldHandler
Re: Consolidate Messages
Hi Glen,
you can also do this:
But "outsourcing" the actual command(s) like SparkOut showed is the better way!
Best
Klaus
you can also do this:
Code: Select all
on enterinfield
returninfiled
end enterinfield

But "outsourcing" the actual command(s) like SparkOut showed is the better way!
Best
Klaus
Re: Consolidate Messages
Not specifically what you asked, but my general rule of thumb is that if code occurs only once, I put it inline in a handler. If code needs to happen in more than one place, I move it to its own handler or function and then call that from wherever it's needed (like SparkOut did.) You were smart to ask about it.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Consolidate Messages
Thanks everyone, GR8 stuff!!