Confirming a thing about IDs

Bob Sneidar bobsneidar at iotecdigital.com
Thu Oct 11 21:45:32 CEST 2018


This is true, until you copy the control and paste it elsewhere, or copy/clone a group or card it belongs to and paste it elsewhere. The stack has an auto incrementing ID, and any time a new object is created it gets that ID, and the stack ID is incremented by 1. This is a blessing and a curse. You have to think if it as the ID of the INSTANCE of an object. For instance (no pun intended) every time a datagrid redraws, it creates all new objects, and each object gets the next ID. I think my project has IDs in the millions now. 

I'm not sure if there is a limit for these IDs. When datagrids first came out, this was a discussion that was had, about what would happen if a stack eventually reached this limit. However, I think the limit is so incredibly high that it is extremely unlikely. 

Bob S


> On Oct 11, 2018, at 12:11 , Geoff Canyon via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> I had never tried this before. It seems to work, but I figured I'd run it
> by the list, both as a way of confirming and informing.
> 
> Is it accurate that
> 
> <type> id <id> of stack "<stack name>"
> 
> is a complete and unique identifier for any control? (with the exception
> for fields noted below)
> 
> For example, suppose there is a button in a group in a group that is a
> background in stack "untitled 1". Further, suppose that background is not
> placed on the current (or any) card in stack "untitled 1". Then the long id
> of the button might be:
> 
> button id 1003 of group id 1004 of bkgnd id 1006 of stack "Untitled 1"
> 
> But, for example, this returns true:
> 
> put there is a button id 1003 of stack "untitled 1"
> 
> And as far as I know, there will never be any other button with id 1003 in
> that stack. So
> 
> button id 1003 of stack "untitled 1"
> 
> is a unique and permanent id for that button, no matter what card, group,
> or background it is in/on or not.
> 
> Is this correct? (mind blown if it is)




More information about the use-livecode mailing list