in reply to Problem in generating ids through Array
Dave.
I believe we are looking at an indentation level -> paragraph numbering algorithm, unless the OP states otherwise.