Question about handler efficiency
Question about handler efficiency
- Subject: Question about handler efficiency
- From: Bill Planey <email@hidden>
- Date: Mon, 5 Feb 2001 20:20:52 -0600
I have a question about handlers. I have a variety of handlers that load
for different search/replace circumstances in MSWord (the handlers make
calls to Visual Basic, and since those calls are by nature very wordy,
they save me a lot of trouble.
My question is this: would it be smart/efficient to combine several of
these handlers into the same handler (say "TextHandler"), just with
different tags calling the different appropriate portion. For example:
on ReplaceText(oldText, newText)
-- do stuff, invoking oldText and newText
end ReplaceText
on ReplaceCase(oldText, newText)
-- do stuff, invoking oldText and newText
end ReplaceCase
...so that in the Script which uses TextHandler its different parts could
be invoked thus:
tell TextHandler
ReplaceText("FindString", "ReplaceString") -- where "FindString" and
-- "ReplaceString" are stated in the script
ReplaceText("FindString", "ReplaceString")
ReplaceText("FindString", "ReplaceString") -- etc.
end tell
tell TextHandler
ReplaceCase("FindString", "ReplaceString")
ReplaceCase("FindString", "ReplaceString")
ReplaceCase("FindString", "ReplaceString") -- etc.
end tell
...or would it be better to keep them as they are now, separated into
different scripts, and loaded separately (which takes several more
statements to articulate)?
Thanks,
Bill Planey