For each loop not printing list in numerical order

I have a for each loop going to a list to print each item. However the index does not print in numerical order. Would like to know why, given when using the For each loop to view future data can cause me to waste time thinking there was an error.

Data printed:
image

For Each loop:
image

Hi @Nelson.R ,

Are you using a For Each or a Parallel For Each?
I have a feeling that you are using the latter, could you check and confirm?

Kind Regards,
Ashwin A.K

we do have sometimes small delays resulting to reorders

Quick dirty: use a mini delay before log
Alternate: log the list in one go with the help of

String.Join(Environment.NewLine, daysWeeks.Select(Function (x,i) i.ToString & " - "& x.toString))

Confirmed it was a For Loop

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.