Why is the Stack ID wrong?

Howard Bornstein bornstein at designeq.com
Wed Jan 22 11:11:01 EST 2003


>Anyway I'm still scratching my head, bit of an unsolved problem and 
>strangeness.  Anyone else got any ideas why you can't reference a stack 
>by its ID?

Hi Matt,

Try this in your button:

on mouseUp
   put the abbrev id of this stack into tThisID
   put tThisID
   set the altID of this stack to the last word of tThisID
   hide tThisID 
end mouseUp

According to the docs on altID:

"This property can be used to ensure compatibility with imported 
SuperCard and HyperCard stacks that assume buttons and fields are created 
with sequential IDs. You can also use the altID of a stack as a 
consistent way of referring to it, since the ID of a stack changes every 
time an object is created."

However, you don't want to do it like I showed (that was just a quick 
example) because the docs also state:

"Important!  Be careful not to set an object¹s altID property to the ID 
of an object of the same type. Since both properties are checked when you 
refer to an object by ID, doing this may cause the wrong object to be 
found because its altID property is the same as the ID of the object you 
want."

Regards,

Howard Bornstein
____________________
D E S I G N  E Q
www.designeq.com



More information about the use-livecode mailing list