Sergey,
>It's not a bug. See my reply to Frank.
You were too fast for me. I was just modifying my reply to be this (but you replied before I could save it).
STOP THE PRESSES! (update) OK, I figured out what is happening. It's because FOR EACH with Collection has problems in certain circumstances, due to the fact that Collection actually uses a COM interface internally.
You have two solutions:
1) Pre-VFP9 use FOR lnLoop = 1 TO THIS.Count:
for lnloop = 1 TO this.count
? this.item(lnLoop).ddate
endfor
2) In VFP9 add the FOXOBJECT keyword onto the FOR EACH line:
for each loItem in this FOXOBJECT
? loItem.dDate
endfor
From VFP9 help:FOR EACH ... ENDFOR Command Preserves Object Types
Visual FoxPro now includes the FOXOBJECT keyword for the FOR EACH ... ENDFOR command to support preservation of native Visual FoxPro object types.
FOR EACH objectVar [AS Type [OF ClassLibrary ]] IN Group FOXOBJECT
Commands
[EXIT]
[LOOP]
ENDFOR | NEXT [Var]
The FOXOBJECT keyword specifies that the objectVar parameter created will be a Visual FoxPro object. The FOXOBJECT keyword only applies to collections where the collection is based on a native Visual FoxPro Collection class. Collections that are COM-based will not support the FOXOBJECT keyword.
For more information, see FOR EACH ... ENDFOR Command.