Stack script problem

Jan Schenkel janschenkel at yahoo.com
Thu Sep 11 03:16:00 EDT 2003


--- Rolf Kocherhans <rolfk at vetvir.unizh.ch> wrote:
> I made a stack script which would delete the
> contents of a field in a 
> substack
> which I open as sheet.
> 
> The script goes like this and is in the main stack:
> 
> on openStack
> put empty into field "fldLog" of stack "Log"
> end openStack
> 
> Now, my field gets emptied every time I open the
> Stack  "Log"  as sheet,
> but I would expect that it is emptied only at
> startup, when the main 
> stack gets loaded.
> 
> Any clues ?
> 
> Cheers
> Rolf
> 

Hi Rolf,

When a stack is opened as a sheet, the engine sends an
'openStack' message ; if you don't handle it at card
or stack levcel in your syubstack, this message will
travel up the message path, comes by the mainStack and
executes the 'openStack' handler in its script.
So one way of solving this problem would be to simply
trap the 'openStack' message in the stack script of
your substack, and not 'pass' it.

Hope this helped,

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



More information about the use-livecode mailing list