Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Kooky SET DATE
Message
From
23/09/1998 23:06:55
Larry Long
ProgRes (Programming Resources)
Georgia, United States
 
 
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Title:
Miscellaneous
Thread ID:
00137626
Message ID:
00140187
Views:
36
>>>>There is definitely something screwy going on. The following code...
>>>>
>>>>*part 1
>>>>set date to dmy
>>>>x={12/08/98}
>>>>? x, day(x), month(x), year(x)
>>>>*part 2
>>>>set date to mdy
>>>>x={12/08/98}
>>>>? x, day(x), month(x), year(x)
>>>>
>>>>should return...
>>>>
>>>>12/08/98 12 8 1998
>>>>12/08/98 8 12 1998
>>>>
>>>>but depending on which part I comment out and then re-run, I either get
>>>>
>>>>08/12/98 12 8 1998
>>>>12/08/98 12 8 1998
>>>>
>>>>or
>>>>
>>>>08/12/98 8 12 1998
>>>>12/08/98 8 12 1998
>>>
>>>Your date setting in effect at the time the .PRG is COMPILED controls which you see. For some reason, if you put some kind of wait state in between, (I used MessageBox), the date constants get re-evaluated to what your current setting in the .PRG is. I don't know why that is, but that sure is what is happening.
>>>
>>>IE:
>>>At command window:
>>>SET DATE TO MDY
>>>COMPILE DateTest.PRG
>>>DO DateTest
>>>
>>>This gives you the Month OK
>>>
>>>Now do:
>>>SET DATE TO DMY
>>>COMPILE DateTest.PRG
>>>DO DateTest
>>>
>>>This gives you the different results.
>>>
>>>DateTest.PRG:
>>>SET DATE TO MDY
>>>dv = {12/08/98}
>>>?MONTH(dv)
>>>SET DATE TO DMY
>>>dv = {12/08/98}
>>>?MONTH(dv)
>>>
>>>
>>>If you use the date constant format {^1998/12/08} it will always be the month.
>>
>>1) Where did you find the date constant format? I couldn't find it in the VFP
>on-line help.
>
>See Help: StrictDateEntry
>
>>2) Can anyone tell me if this has been fixed in VFP6?
>
>It still works the same way in VFP6.
Has anyone checked to see if this bug has been reported to M$?
L.A.Long
ProgRes
lalong1@charter.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform