Information générale
Catégorie:
Codage, syntaxe et commandes
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement