Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Export to a flat ASCII file
Message
De
02/11/2001 20:14:12
 
 
À
02/11/2001 19:56:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00577063
Message ID:
00577071
Vues:
51
The easy way is the best way but if you also want to output an open table in a custom format you could also do a variation of the following (in a real program you would check the arguments of FPUTS, FCREATE and FCLOSE for failure...)

cMyFile = "c:\test_sdf.txt"
nHandle = FCREATE(cMyFile)
Afields(ArrFields)
FOR nCount = 1 TO RECCOUNT()
GOTO RECORD nCount
cOutput = ""
FOR nCount2 = 1 TO FCOUNT()
cField = ArrFields(nCount2,1)
cType = ArrFields(nCount2,2)
nWidth = ArrFields(nCount2,3)
nDecimals = ArrFields(nCount2,4)
cOutput = cOutput + IIF(cType = "C",LEFT(EVAL(cField),nWidth),;
STR(EVAL(cField),nWidth,nDecimals))
ENDFOR
FPUTS(nHandle, cOutput)
ENDFOR
FCLOSE(nHandle)
CLOSE ALL
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform