General information
Category:
Coding, syntax & commands
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
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only