Erwin Pombett
asked on
in a foreach, how can i view the current and the next element in the bloc?
hello,
i have a foreach loop on an ArrayList,
foreach(MyObj anObj in ArrayList){
anObj.method();
<- how can i catch the following objt in the same bloc?
}
thank you in advance.
i have a foreach loop on an ArrayList,
foreach(MyObj anObj in ArrayList){
anObj.method();
<- how can i catch the following objt in the same bloc?
}
thank you in advance.
add an int32 or something outside of the foreach instantiated and set = to 1. then just increment each time in the foreach you can use this to index the next value.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.