>Nadya --
>
> I find myself programming in the spirit of this discussion.
>
> In that scenario you describe I use DO WHILE rather than FOR..NEXT for all of the loops. I recently coded a list box that displays a Chart of Accounts. It draws on 2 tables -- 1 of major and minor ranges and the other of individual accounts. I used logic similar to what you have -- 3 nested loops -- that to position each range or account properly in the array.
>
> The general guideline I use is this:
>
>1. If the loop is based on a specific number of operations, I use FOR..NEXT.
>
Jay, this loop uses a counter, that's why I used for next loop. All loops should be terminated, if user decides to esc, so I had to put exit in each inner loop, which uses for next construct. I asked this question here while ago and this was the advice I got, so I scaned through the code and did it.
>2. If the loop is based on a specific condition, I use DO..WHILE.
>
> Often, in a nested situation, if one loop requires a condition, they all will.
>
>
>Enjoy!
>
>Jay
If it's not broken, fix it until it is.
My Blog