gscarter
07-21-2008, 02:35 AM
If i am iterating through an array, and performing a test at each iteration for example:
For Each customer in month1
If customer = Gary & version = 1
End if
Next customer
I want to do multiple iterations through the array, but omit the array elements that satisfied the first 'IF' statement. Can i do:
For Each customer in month1
If customer = Gary & version = 1
customer = ""
End if
Next customer
For Each customer in month1
If customer = Gary & version = 2
End if
Next Customer
Not the best example. Will the second 'FOR EACH' iterate through omitting the results that were picked up by 'customer = Gary' in the first loop. Hence not finding any results because Gary has already been counted in the first loop.
Say the customers may have multiple versions, but i only want to count them in the first foreach.
Im trying to get my head around it myself so if this makes no sense please let me know.
Gary
For Each customer in month1
If customer = Gary & version = 1
End if
Next customer
I want to do multiple iterations through the array, but omit the array elements that satisfied the first 'IF' statement. Can i do:
For Each customer in month1
If customer = Gary & version = 1
customer = ""
End if
Next customer
For Each customer in month1
If customer = Gary & version = 2
End if
Next Customer
Not the best example. Will the second 'FOR EACH' iterate through omitting the results that were picked up by 'customer = Gary' in the first loop. Hence not finding any results because Gary has already been counted in the first loop.
Say the customers may have multiple versions, but i only want to count them in the first foreach.
Im trying to get my head around it myself so if this makes no sense please let me know.
Gary