put into named field weirdness

Russell Martin russell_martin at yahoo.com
Mon Feb 11 16:29:47 EST 2008


Wow. Thank you.

That was completely counterintuitive, but, you are 100% correct.

Now, after opening my prefs stack, I have a line:

set the defaultStack to [NAME_OF_MY_MAIN_STACK]

..and now, inside of my readPrefsFile handler, I'm back to:

put lNewFilesList into field "FilesField"

..and the "Chunk: No such object" error is gone.

I don't think I ever would have figured that out. I mean, I thought
'this stack' would always refer to the stack whose script is running.

So, is there another way to refer to the stack that the currently
executing script belongs too? One that remains constant? Maybe
something like 'target owner'?

--- "J. Landman Gay" <jacque at hyperactivesw.com> wrote:

> Russell Martin wrote:
> 
> > ...now, within my openStack handler, just before I spit out the
> answer
> > dialog and then call my readPrefsFile handler, I do, inside of my
> > openPrefsFile handler, open a separate stack stored on disk, but
> once
> > that handler completes and execution returns to the line below it,
> how
> > does the recently opened preferences stack then become the stack
> that
> > is calling readPrefsFile?!? That doesn't make any sense.
> 
> The stack that is running the script is not necessarily "this stack".
> 
> "This stack" is effectively the same thing as the defaultstack, which
> is 
> reset when you open a stack. So, in your scripts, you open the main 
> stack, which is also the defaultstack. The main stack opens the prefs
> 
> stack, which in turn becomes the defaultstack. The prefs stack will 
> remain the defaultstack until you either go back to the main stack,
> or 
> set the defaultstack to the main stack specifically in a handler.
> 
> Use "set the defaultstack to 'my_main_stack'" in your script before 
> trying to work with any fields in the main stack.
> 
> I have several projects that use an invisible prefs stack that stays 
> open all the time, and I have to do the same thing with those. I need
> to 
> reset the defaultstack after opening my invisible prefs so that
> scripts 
> will be directed to the right stack. Otherwise all commands would be 
> directed to the last-opened stack (my prefs stack) which isn't what I
> want.
> 
> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
> _______________________________________________
> 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
> 



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs



More information about the use-livecode mailing list