Manipulate Stacks with Duplicate Names?

Jeanne A. E. DeVoto revolution at jaedworks.com
Thu Oct 13 15:11:10 EDT 2005


At 11:23 PM -0700 10/12/2005, Scott Rossi wrote:
>  >> Is there any way to distinguish between newly created
>>>  (unsaved) stacks that have the same name?
>
>>  How about using the stack's ID?
>
>I seem to recall reading on the list long ago that it was somehow possible
>for multiple opened stacks to have duplicate IDs, and (because of this)
>referencing stacks by ID wasn't reliable.  Is this actually the case or have
>I spent years mistakenly avoiding referencing stacks by ID?

There are some nuances. Newly created stacks start out with ID 1002. 
A stack's ID increments when you create an object, and you can also 
change it manually.

So you'd need to do a little work: "set the ID of last stack" when 
you create it, or set the ID in the templateStack before creation, 
and make sure to choose the numbers such that there's no overlap 
possibility if you're creating objects in the new stack. But it 
should be workable.
-- 
jeanne a. e. devoto ~ revolution at jaedworks.com
http://www.jaedworks.com



More information about the use-livecode mailing list