Reset Control ID Numbering
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Reset Control ID Numbering
I have an app where it generates new controls from a .csv file each time it is opened. So the control ID numbers are being regenerated each time and are getting up to 7 digit numbers now. I understand from previous posts that the newly generated control ID numbers continue off from the last saved version when developing. But I couldn't find a solution to reset these. I'm still developing the same app and I save and test often, so the numbers will keep augmenting. Is there any way to reset them so they don't continue to grow ?
thanks,
Richard
thanks,
Richard
Livecode Indy 9.6.11 (Stable)
MacOS Sonoma 14.2
Xcode 15.0.1 SDK 17.0
MacOS Sonoma 14.2
Xcode 15.0.1 SDK 17.0
Re: Reset Control ID Numbering
Hi.
For controls, ID's are assigned at creation and cannot be changed. In fact, the ID for a deleted object is retired, and cannot be used.
See the dictionary. Stacks and images are different in this regard, but that will not help you.
Might you ignore the actual ID, and use the "altID" instead? This is a property that is open to you.
Craig Newman
For controls, ID's are assigned at creation and cannot be changed. In fact, the ID for a deleted object is retired, and cannot be used.
See the dictionary. Stacks and images are different in this regard, but that will not help you.
Might you ignore the actual ID, and use the "altID" instead? This is a property that is open to you.
Craig Newman
Re: Reset Control ID Numbering
Thanks for the quick reply Craig !
I thought that might be the case. A large part of my app is built around using the control ID's from the newly generated controls. It works well as is, I just thought the numbers were getting a little big:) . As long as it doesn't affect the performance, I'm ok with it..
much appreciated,
Richard
I thought that might be the case. A large part of my app is built around using the control ID's from the newly generated controls. It works well as is, I just thought the numbers were getting a little big:) . As long as it doesn't affect the performance, I'm ok with it..
much appreciated,
Richard
Livecode Indy 9.6.11 (Stable)
MacOS Sonoma 14.2
Xcode 15.0.1 SDK 17.0
MacOS Sonoma 14.2
Xcode 15.0.1 SDK 17.0
-
- VIP Livecode Opensource Backer
- Posts: 10049
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Reset Control ID Numbering
You'll have at least two billion new objects before you need to think about a reset. An automated moving of objects to a new stack can cover that - if you get that far let us know. 

Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Reset Control ID Numbering
Richard (raugert) - you can change object IDs after creation, as long as you don't duplicate existing ones.
In general, new objects are created with sequential IDs, starting from the ID of the stack itself. You can set the ID of the stack itself, but that's not very rewarding since you can only bump it up, not down. But all other controls (and cards) have mutable IDs.
In general, new objects are created with sequential IDs, starting from the ID of the stack itself. You can set the ID of the stack itself, but that's not very rewarding since you can only bump it up, not down. But all other controls (and cards) have mutable IDs.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: Reset Control ID Numbering
Yep, Mark is correct.
You know, I knew this about LC. I was still stuck in HC thinking, where you cannot change the ID.
But the dictionary explicitly says it ain't so, that a control's ID is immutable. This seems to be, er, wrong. I am sending this to QCC.
Craig
You know, I knew this about LC. I was still stuck in HC thinking, where you cannot change the ID.
But the dictionary explicitly says it ain't so, that a control's ID is immutable. This seems to be, er, wrong. I am sending this to QCC.
Craig