Free Support Forum - aspose.com

ArrayLists and TaskUtils

Hi,

I needed to iterate through the whole tree of tasks. I started by using the TaskUtils.apply and the ITreeAlgoritym class based upon your sample project ... Very nice structure ... however, I found I was not able to see all of the tasks - about 1/3 were missing. I then did a recursive routine to iterate through the tasks and found the same (or similar) result.

I then changed the loop in the recursive routine from:

For each pobjChild in the Array list

next

To

For pindex = 0 to count -1

next

And I now see all of the tasks in the project in the correct task order. Is there a simple reason why one type of loop skips tasks and the other finds them in the correct order. (I'm new to ArrayLists..).

Regards, Bruce

Hi Bruce,

The only difference between "For Each" and "For" statement is that "For Each" depends upon the correct implementation of IEnumerator interface, whereas, "For" statement is a simple loop.