At 5:45 AM -0700 8/31/2001, Rob Stevenson wrote:
>I just checked out one of the HC stacks I'd be interested in converting.
[...]
>Glancing through them I see that quite a few of the handlers are short
>enough to fit into the 10 line limit, but obviously quite a few are not.
>Several are in the range of 50 or more lines, and they already call out
>to sub-handlers or functions so I'm not sure I could make them any more
>granular.
A tough case. "Using the Starter Kit" does provide some hints and examples
of converting long handlers to run within the limits. Also, some things in
HyperTalk can be done in fewer lines of Transcript. Finally, remember the
"10 line limit" is command lines - control structures don't count towards
it, so if your 50-line scripts include a number of repeats and if/then
constructs for control, you might be closer than you think to being able to
wedge them into the Starter Kit limits.
>Is it possible I'm mis-understanding something? You suggest insert script
>to place objects in the message path. Fair enough, but aren't all of
>those objects, indeed all of those inserted scripts, limited to the same
>10 lines? Or is it possible to place a much longer script into, say, a
>hidden field, then use insert script to read that in and run it when
>needed?
No, you're right the first time: each object's script needs to fit inside
the limit in order to compile in the Starter Kit.
Although code does not need to reside in a script - like HyperCard,
Revolution supports the "do" command, and you can "do" up to ten lines in
the Starter Kit (unlimited in the licensed versions). For convenience, you
can do something like place several code snippets in a hidden field (or in
a custom property, or a global variable) and use statements such as
do line 5 to 12 of field "Holder"
or
do the myCustomProperty of button "Some Button"
to execute them a piece at a time. It's possible in this way to slice a
long handler into several chunks, each in a custom property, and use a
construction such as:
on mouseUp
do the thisCustomProperty of me
do the thatCustomProperty of me
do the theOtherCustomProperty of me
end mouseUp
Again, there's an example of this technique in "Using the Starter Kit". It
does require a disciplined approach to things like naming conventions, and
it is not as easy to modify and maintain as a handler that's completely
contained in one object's script, but it is possible to write code in this
way and keep it fairly comprehensible and untangled, with a little care.
--
Jeanne A. E. DeVoto ~ [EMAIL PROTECTED]
http://www.runrev.com/
Runtime Revolution Limited - Power to the Developer!