Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ctod() weirdness
Message
From
13/08/2015 09:18:19
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
13/08/2015 07:40:26
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01623085
Message ID:
01623285
Views:
54
>... (Nor do I have any clear idea why, according to Visual FoxPro, I should set century to 19, when we are actually in the 21st century...)

You ar kidding, arent you?
The century we are in (eg 21st) should not be mixed with the year. This might create havoc. If we are in the 21st, then 19xx is in the 20th so far that is fine.
IOW The SET CENTURY deals with the century part of a year not with the century you are living in.

The ways tiny weak defines century and rollover on SET CENTURY TO w/o any other argument are rather complex. In general it should work as expected. A number that looks like it is in the past (this is for today a number between 65->99 will end up in 19xx while all 0 to 64 will be in 20xx ). This will switch in 2050 so that it will end up 20/21. You might play with your system date and SET CENTURY TO

But if you are shure that no fool will enter 99 meaning 1999 do SET CENTURY TO 20 ROLLOVER 0 and any number nn will be 20nn. Or force a meaningfull date format. Two year date should be done since the late 1990s.

The problem is, that the help of SET CENTURY seems to mix up VFP Version 5; pre Version 5 and post Version 5 stuff. At least I get not the results I read from the help for SET CENTURY TO

HTH

Lutz
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Reply
Map
View

Click here to load this message in the networking platform