ForEach() begins with index 1, and Index 0 is the last!?

Discuss any general programming issues here
Post Reply
bitRocky
Posts: 148
Joined: Fri Nov 14, 2014 6:01 pm

ForEach() begins with index 1, and Index 0 is the last!?

Post by bitRocky »

This code:

Code: Select all

t = {"Null", "Eins", "Zwei", "Drei", "Vier"}
DebugPrint("ForEach:")
ForEach(t, DebugPrint)

DebugPrint("ForEachI:")
ForEachI(t, DebugPrint)
Gives this output:

Code: Select all

ForEach:
1 Eins
2 Zwei
3 Drei
4 Vier
0 Null
ForEachI:
0 Null
1 Eins
2 Zwei
3 Drei
4 Vier
You see that when using ForEach() the first index (index 0) is display at last.
While ForEachI() does it correct.
Is it normal? Why?
Post Reply