Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set century
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01013353
Message ID:
01013430
Views:
11
This message has been marked as the solution to the initial question of the thread.
Nadya

This all looks like a bug to me. At least, I could not find it somewhere clearly documented in VFP 7/8/9. Here is how to reproduce the behavior:
CLEAR

set century TO 19 ROLLOVER 55   && default

?SET("century",2)  &&55

lnyear=VAL(RIGHT(DTOC(DATE()),2))+1
set century ON TO 19 ROLLOVER lnyear    

?SET("century",2)   *&& still 55, why?

for i=1 to 10
	?ctod('01/01/'+ transform(m.i))  && rollover 6 does not work
NEXT

set CENTURY TO 19 ROLLOVER lnyear

?SET("century",2)   && now it is 6, because of ON was removed?
for i=1 to 10
	?ctod('01/01/'+ transform(m.i))   && rollover 6 works
NEXT

* Try with ON again
set CENTURY ON TO 19 ROLLOVER lnyear 

?SET("century",2)     && it is 6 however, why?
for i=1 to 10
        ?ctod('01/01/'+ transform(m.i))  && rollover 6 works, and with ON !?
NEXT
So, it looks like the set .. rollover.. statement must be without ON

>I'm not sure why it didn't work for me, but this works:
>
>lnYear = VAL(RIGHT(TRANSFORM(YEAR(DATE())),2))+1
>
>
>>This works for me:
>>
>>lnyear=VAL(RIGHT(DTOC(DATE()),2))+1
>>set century ON TO 19 ROLLOVER lnyear
>>
>>for i=1 to 10
>>	?ctod('01/01/'+ transform(m.i))
>>next
>>
>>
>>>Hi everybody,
>>>
>>>I want to be able to type two year digits in the date textbox and treat dates this way: if they less than current year, e.g. 01/01/05 treat them as 2005, otherwise, 1/1/43 treat as 1/1/1943. I could not make it to work, have to admit.
>>>
>>>I'm using VFP9.
>>>
>>>Can you please help me?
>>>
>>>Thanks a lot in advance.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform