Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making CTOD() work in Europe
Message
From
18/11/2018 12:23:56
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01663465
Message ID:
01663509
Views:
43
>Hi,
>
>As I go through my program, I see many places where I convert a string to date, using CTOD(), hard-coded with MM/DD/YYYY. But if the date is (for example), British ("DD/MM/YYYY") it won't work.
>
>How do you suggest I change all places that use CTOD() from hard-coded use of American date system to another?
>
>TIA

Aside from bits you mention regarding date and time and numeric formats (e.g. decimal point and comma), there's also the bit about paper size that will probably come up (e.g. A4 is slightly narrower and taller than US letter size).
You may also have seen my occasional comments about some of the stuff you'd have to be careful about when dealing with East Asian languages such as Chinese, Japanese and Korean -- and how *each* may have two or three major variants in the double-byte encodings. You may have seen my occasion reminder to avoid string literals containing characters within upper ASCII range (this is because many of the prefix and "shift" characters in double-byte character set tend to be in this range).
Other changes you may have to make in your code may also involve different formatting for mailing address (e.g. commonly you may restrict input to digits only for zip code, but postal codes can be alphanumeric). Phone numbers could be a pain -- the formats may not only vary by country, but also region within country as well. I do recall one "hack" to reduce storage space for phone numbers was to store it in a 32-bit binary value (it did involve swapping the order of two of the digits -- it is based on the assumption that the middle digit of the area code was always a zero or one) -- which promptly broke in the 1990s.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform