Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Program works ok in VFP but not from explorer
Message
De
30/10/2015 09:26:40
 
 
À
29/10/2015 14:21:24
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01626541
Message ID:
01626700
Vues:
69
>>But understand that Naoto has explained why you had the problem. In general, you should avoid any code that relies on knowing the date format. If you must depend on it, then you need to set it when you need it.
>>
>>Tamar
>
>Hi Tamar,
>
>just out of curiosity.
>How will one define a interface, let's say csv, and not define date format? I allways do something like
>field n use blabla type date in the form YYYY-MM-DD in the interface documentation and SET DATE for the import.
>If the import comes with DD.MM.YYYY it's like an alpha in a numeric field. Or would you parse each and every field? This could be a challenge - in time sense. :)

So what I left out of my general warning was "wherever possible." Sometimes, you're presented with data that's already formatted and have to deal with it, like your CSV example. In that case, document the expected format and depending on the situation, either wrap the thing in TRY-CATCH, so you can report problems, or write the code that does the checking.

Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform