Cloning stack reset object IDs?

Bob Sneidar bobs at twft.com
Fri Jan 27 12:20:53 EST 2012


It is because of this sort of thing that I think the engine needs to be updated to reuse unused ID's. It would be a simple matter to have the engine reset the stack ID to the lowest unused ID if it ever ran out, and then check for the next available ID when it sets the stack ID after an object gets created. If they did that, then a developer could simply set the stack ID to 0 if he wanted to do it himself, and have the engine find the next unused ID. I suppose there would have to be an index of some sort, of objects and their ID's. There may already be such a thing in the stack structure. 

Bob


On Jan 27, 2012, at 9:04 AM, Pete wrote:

> Hi Richard,
> Just the datagrid group, not the stack itself.
> 
> Here's what I see when cloning.  If I clone a card, the controls on it are
> given a new set of IDs.  If I clone a stack, the controls within the new
> stack retain the IDs from the original stack.  I guess that's what I would
> have expected.
> 
> One other thing I noticed when I was doing this test.  The IDs of the
> controls I put on the first card I set up for the test weren't numbered
> consecutively, they were 1004, 1006, 1008, etc.  When I cloned that card,
> the IDs were consecutive, 1011, 1012, 1013, etc.  Is there a reason why the
> first card's control IDs went up in 2's?
> 
> Pete
> 
> On Fri, Jan 27, 2012 at 7:54 AM, Richard Gaskin
> <ambassador at fourthworld.com>wrote:
> 
>> Pete wrote:
>> 
>>> I just cloned a datagrid to see what would happen.  I'm afraid all the
>>> control ids just carried on from the last one used in the original
>>> datagrid
>>> so using clone doesn't help.
>>> 
>> 
>> Was that just the dataGrid group or the whole stack?
>> 
>> Since the stack governs the IDs of objects within it, I would imagine that
>> cloning the stack as a whole would preserve existing IDs, but here whenever
>> I copy any object from one stack to another the ID is automatically reset
>> to use the next available ID for the target stack.
>> 
>> --
>> Richard Gaskin
>> Fourth World
>> LiveCode training and consulting: http://www.fourthworld.com
>> Webzine for LiveCode developers: http://www.LiveCodeJournal.com
>> LiveCode Journal blog: http://LiveCodejournal.com/**blog.irv<http://LiveCodejournal.com/blog.irv>
>> 
>> 
>> ______________________________**_________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/**mailman/listinfo/use-livecode<http://lists.runrev.com/mailman/listinfo/use-livecode>
>> 
>> 
> 
> 
> -- 
> Pete
> Molly's Revenge <http://www.mollysrevenge.com>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list