IF FILE('export.csv') && Does file exist?
gnErrFile = FOPEN('export.csv',12) && If so, open read-write
IF gnErrFile > 0
lfield = ""
FOR gnCount = 1 TO FCOUNT() && Loop for number of fields
lfield = lfield + FIELD(gnCount) + IIF(gnCout ==FCOUNT(),"","|")
NEXT
FCLOSE(gnErrFile)
lfield = lfield + CHR(13)+CHR(10)+FILETOSTR('export.csv')
STRTOFILE(lfield, 'export.csv')
ENDIF
ENDIF
HTHAgainst Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.