incremental renaming - get unique name
I think this is very simple, but I don't know how to do it!
let's say I have array A which contains unique names!
when I want to rename element i.name I want to add automatically a number - 01, 02 and so on!
let's say I have
"element" - > after renaming I should get "element_01"
"element_01" - > after renaming I should get "element_02"
and so on!
Except this I should everytime check:
if (finditem A "element_01" == 0) then
i.name = "element_01"
i.name = incrementfn "element_01"
append A i.name