Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Append from type sdf not y2k compliant
Message
De
14/01/2000 22:52:27
 
 
À
14/01/2000 09:59:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00318139
Message ID:
00318463
Vues:
28
>It seems that when you use the command APPEND FROM TYPE SDF that VFP6 does not behave like VFP5. All date field that are appended do not use the set century, rollover, information. Example: input date = 12/12/99, what you get in your date field after the append is 12/12/0099. This command work properly in VFP5 and definitely does not work in VFP6.
>
>Is these any work around for this???

Dates imported via SDF in the form YYYYMMDD are handled correctly; I tend to massage dates into this format to get a reliable date for the append TYPE SDF or DELIMITED; alternatively, pull them in as strings and use CTOD() to convert them after doing appropriate SET CENTURY things; you can STUFF the DTOS(CTOD()) of a MM/DD/YY formed date back in place of the MM/DD/YY value to fix it up. For example if you had an 80 character record terminated with a CR/LF pair, with a MM/DD/YY date starting at position 10 of each record, the following would fix up things nicely:
LOCAL cFileAsString, nPosInFile, nStringLen
#DEFINE RECLEN 82
#DEFINE DATELEN 8
#DEFINE DATEOFFSETPOSINREC 10
cFileAsString = FILETOSTR('test1.txt')
nPosInFile = DATEOFFSETPOSINREC
nStringLen = LEN(cFileAsString)
DO WHILE nPosInFile  + DATELEN < nStringLen
   cFileAsString = STUFF(cFileAsString, nPosInFile,DATELEN,DTOS(CTOD(SUBST(cFileAsString,nPosInFile,DATELEN))))
   nPosInFile = nPosInFile + RECLEN
ENDDO
=STRTOFILE(cFileAsString,'FileOut')
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform