Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Export to a flat ASCII file
Message
From
02/11/2001 20:14:12
 
 
To
02/11/2001 19:56:54
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00577063
Message ID:
00577071
Views:
52
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
Map
View

Click here to load this message in the networking platform