Page 1 of 1

Reset Control ID Numbering

Posted: Thu Jan 31, 2019 11:37 pm
by raugert
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

Re: Reset Control ID Numbering

Posted: Thu Jan 31, 2019 11:44 pm
by dunbarx
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

Re: Reset Control ID Numbering

Posted: Fri Feb 01, 2019 12:41 am
by raugert
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

Re: Reset Control ID Numbering

Posted: Fri Feb 01, 2019 12:49 am
by FourthWorld
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. :)

Re: Reset Control ID Numbering

Posted: Fri Feb 01, 2019 5:14 am
by mwieder
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.

Re: Reset Control ID Numbering

Posted: Fri Feb 01, 2019 3:26 pm
by dunbarx
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