Control ID problem

Peter Haworth pete at
Sun Mar 27 15:27:18 EDT 2011

I've made the changes necessary to use long IDs in my application as suggested by Scott.  For my own eduction though, I'd like to understand how the defaultStack property is used.

As a refresher, the following statement is being rejected with an error that it can't find the control:

"put the short name of control ID pid into myName" (where pid is a short ID of the control)  

Immediately before executing the above command, The defaultStack property contains the name of the stack containing the control.  If I refer to the control as "control ID of stack the defaultStack" , the statement executes successfully.  

So my questions are:

- When is the defaultStack property taken into account when referencing a control?
- When the defaultStack property is not used, which stack is assumed and is there a property that refers to it?

Thanks for any enlightenment.

Pete Haworth

On Mar 25, 2011, at 1:52 PM, Scott Rossi wrote:

> Yes, setting the defaultStack to the name of the substack *should* work.
> You may want to check that you're not inadvertently setting focus back to
> the main stack somewhere in your scripts.

More information about the Use-livecode mailing list