Mike Lewis
Programmer
Just came across something I can't understand.
Consider this code:
That works as expected. But now consider this:
You would think both of these constructs would be identical. But in the first code, the date property is correctly recognised as a date, but in the second, VFP treats it as a datetime.
This is in VFP 9.0, SP1. The collection is a native VFP collection of objects, not a COM collection.
Very rum.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
My Visual FoxPro site: www.ml-consult.co.uk
Consider this code:
Code:
FOR lnI = 1 TO MyCollection.Count
loObj = MyCollection.Item(lnI)
? VARTYPE(loObj.dStart)
&& dStart is a date property of the object, so
&& this correctly displays "D"
ENDFOR
That works as expected. But now consider this:
Code:
FOR EACH loObj IN MyCollection
? VARTYPE(loObj.dStart)
&& dStart is still a date property. But this
&& now displays "T"
ENDFOR
You would think both of these constructs would be identical. But in the first code, the date property is correctly recognised as a date, but in the second, VFP treats it as a datetime.
This is in VFP 9.0, SP1. The collection is a native VFP collection of objects, not a COM collection.
Very rum.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
My Visual FoxPro site: www.ml-consult.co.uk