Control ID problem
pete at mollysrevenge.com
Mon Mar 28 01:53:56 EDT 2011
Thanks for trying this out. The syntax I had was "put the short name of control ID 1" and it works 99.9% of the time (assuming there is a control id 1), just not in this one circumstance that I haven't been able to track down so I'm not sure what the difference is between what you tried and what I was doing.
I would have expected the defaultStack to work as you described but for some reason it didn't unless I specifically referred to the control as control ID 1 of stack the defaultStack.
It's a moot point now though since I've ploughed through my application and changed all references to IDs to use long IDs instead, more reliable that way. The only thing I had to be wary of was that in a couple of places I am storing long IDs in custom properties and ran into the problem that the long IDs include the fully qualified path to the stack file. That's fine as along as I'm just running in the IDE but when I built a standalone, that caused major problems. I got around it by storing words 1 to -4 of the long ID to omit the stack file name at the end, kinda something between the abbrev name and the long name.
On Mar 27, 2011, at 8:24 PM, J. Landman Gay wrote:
> On 3/27/11 2:27 PM, Peter Haworth wrote:
>> - When is the defaultStack property taken into account when
>> referencing a control?
> It should be as you expected. The control's reference should be evaluated in terms of the defaultstack.
> However... I just tried your original script statement and it fails no matter what the default stack is, or even if you don't bother setting the defaultstack at all. I.e., this fails even when the default stack is the current topstack, and there is only one stack open:
> put the name of control id 1
> I think it's invalid syntax. These work:
> put the name of control 1
> put the id of control 1
> But any reference to "control id x" fails. So the issue isn't the defaultstack at all.
>> - When the defaultStack property is not used,
>> which stack is assumed and is there a property that refers to it?
> If no stack is specified as the default, the topstack is used.
> Jacqueline Landman Gay | jacque at hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode