>procedure copyDelimited >lparameters lcAlias, && name of alias > lcDelimiter, && delimiter may be longer than 1 character > lcOutFile, && name of output file (old file will be overwritten) > llTrim && flag: trim each field or not > > local i, ; > lcOut, ; > fh > > private laFields > > fh = fcreate(lcOutFile) > > if fh > 0 > select (lcAlias) > goto top > scan > copy to array laFields record recno() > for i = 1 to alen(laFields) > if i = 1 > lcOut = iif(llTrim,alltrim(transform(laFields[i])), ; > transform(laFields[i])) > else > lcOut = lcOut + lcDelimiter + ; > iif(llTrim,alltrim(transform(laFields[i])), ; > transform(laFields[i])) > endif > next i > fputs(fh, lcOut) > endscan > fclose(fh) > else > ? "unable to create file" > endif > >endproc