Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
For Each rotation changes type in collection
Message
 
 
To
29/10/2003 06:16:14
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00843966
Message ID:
00843999
Views:
20
That's really cool!! Well...depending on your frame of reference, it may not be. I would guess this has something to do with internal mechanism of collection class. The Enum interface may only deal with datetime as this is supported under COM and simple Date is not.

You should report this at http://support.microsoft.com/default.aspx?scid=/Support/vfoxpro/report/report.asp (link courtesy of David Frankenbach and others).

>When using a for each iteration with a collection, Date-type values get changed to Time-type as shown in the example below !!!
>
>LOCAL loColl, oColl, lnI
>STORE 0 TO lnI
>STORE null TO oColl, loColl
>
>loColl = NEWOBJECT("Collection")
>
>FOR lnI = 1 TO 10
> loColl.Add(DATE()-lnI)
>ENDFOR
>
>FOR EACH oColl IN loColl
> ? VARTYPE(oColl) &&& == Time Type !!!
>ENDFOR
>
>FOR lnI = 1 TO 10
> ? VARTYPE(loColl.item[lni]) &&& == Date Type which is correct !!!
>ENDFOR
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform