I usually make a function that goes with making a new entry into my dynamic array, with that is a persistent counter that goes with the array, and that would be referenced for the number you want.
Hope this helps.
A clever person solves a problem. A wise person avoids it. --Einstein