overloaded stack script

Jim Ault JimAultWins at yahoo.com
Sat Jan 6 04:10:00 EST 2007


On 1/5/07 11:48 PM, "kevin" <trancepacific at gmail.com> wrote:

> Hi All,
> 
> I am running Rev 2.7.4 on the Mac and have a stack script containing
> ~25,000 lines of code. Its hard to edit because Rev runs so slowly with
> so many lines in a script and I'd love to split it up but most of the
> code are functions, not handlers, and furthermore, the script refer to
> controls present on all cards in that stack. By that I mean that a
> member card will call a function in that stack script that will handle
> activity on the card generically.
> 
> I can deal with how slow it is to edit. What I have a harder time
> dealing with is that when I open that stack from another stack, it
> takes quite a few seconds (avg=10 sec) to open a card in that stack
> even when no openStack or openCard handlers are running (or closeCard,
> closeStack handlers for that matter). It appears that it just takes a
> long time in general to open the stack when that many lines of code are
> in the stack script.
> 
> Does anyone have any experience with this type of issue? Maybe I'm an
> idiot for having 25,000 lines of code in the stack script but I don't
> know how to work around this. I see how I could call handlers that
> reside elsewhere but not functions. Any advice would be greatly
> appreciated.
> 
> Cheers,
> Kevin
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

If you study the message path and the available script containers in Rev you
will find that the stack script is only the first of many 'layers' that can
be used and apply to all cards.

One technique is to put some of the scripting lines in a substack, then do
the following line

on openStack
start using stack "subStackofMe"

Also, as a test...
--open the stack with only openstack handler in the stack script
--open the stack with no scripting in the stack script

You can also do other scripting techniques to make the editing easier and
faster.

> I see how I could call handlers that
> reside elsewhere but not functions. Any advice would be greatly
> appreciated.
Handlers and functions can be located the same way.
They can be located in buttons, cards, other stacks, so there is really no
practical limit.

Study the 'back script' capability, plus 'start using' and 'stop using'

Hope this Helps

Jim Ault
Las Vegas






More information about the use-livecode mailing list