View Single Post
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.