Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 02-09-2018, 08:26 PM
FreakaZoid2 FreakaZoid2 is offline
Senior Member
Join Date: Jul 2009
Posts: 361
Default Ideas for tracking/assigning a new number

I am reading many xml files and currently displaying a treeview.
I have an object assigned to each node that has several bits of info including a number. this number is unique for each node. problem is that in the beginning these xml files were manually edited to keep these numbers unique. so the user would just pick some big number and use it to update these xml files with.

Now the question:
Is there a good way to load/track these numbers so that I can find any missing values.
say that 1 thru 3506 are used and then it starts back at 4001 thru 7569
I want to be able to assign 3507 to an added entry into these xml files. So any time in my program I allow users to add a new tree node and i want to auto-assign the next number available.
currently i have an array that has the number and a flag to indicate if it is used or not. problem is that some of the bogus numbers that user put in were like 888,888,888 so my array goes all the way to that number and i have to search it looking for any empty slot.

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

All times are GMT. The time now is 05:29 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.