Here's the example code:
Type t1
Field num1
End Type
a.t1 = New t1
a\num1 = 11
b.t1 = New t1
b\num1 = 33
For b.t1 = Each t1
DebugLog "num1=" + b\num1
Next
Here's the debug log output:
num1=11
num1=33
One would assume that the output in the debug log would be "num1=33" only, since the iteration only concerns "b". It looks like the FOR..EACH command loops through all instances of a given type, regardless of the variable used.
Is there a way to limit the scope of the FOR..EACH command to one variable?
Type t1
Field num1
End Type
a.t1 = New t1
a\num1 = 11
b.t1 = New t1
b\num1 = 33
For b.t1 = Each t1
DebugLog "num1=" + b\num1
Next
Here's the debug log output:
num1=11
num1=33
One would assume that the output in the debug log would be "num1=33" only, since the iteration only concerns "b". It looks like the FOR..EACH command loops through all instances of a given type, regardless of the variable used.
Is there a way to limit the scope of the FOR..EACH command to one variable?