Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
For Each rotation changes type in collection
Message
From
29/10/2003 06:16:14
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
For Each rotation changes type in collection
Miscellaneous
Thread ID:
00843966
Message ID:
00843966
Views:
53
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
Next
Reply
Map
View

Click here to load this message in the networking platform