Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy to delimited ?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00225005
Message ID:
00225039
Views:
45
>I had to do this once. There is nothing natively in VFP to do this. I ended up writing a program with low level file functions to do this.


Here's one way;
LPARAMETERS pcAlias, pcFile

LOCAL laFields, lcAlias, lnCnt, lcField, lcLine
lcAlias = ALIAS()
SELECT (pcAlias)
AFIELDS(laFields,pcAlias)
SET ALTERNATE TO (pcFile)
SET ALTERNATE ON
SCAN
   lcLine = ""
   FOR lnCnt = 1 TO ALEN(laFields,1)
      lcField = laFields(lnCnt,1)
      lcLine = lcLine + ?? ALLTRIM(lcField) + ","
   ENDFOR
   lcLine = LEFT(lcLine,LEN(lcLine)-1)
   ?lcLine
ENDSCAN
SET ALTERNATE OFF
CLOSE ALTERNATE
IF NOT EMPTY(lcAlias)
   SELECT (lcAlias)
ELSE
   SELECT 0
ENDIF
Pass it the table to be copied and file to copy it to.
Previous
Reply
Map
View

Click here to load this message in the networking platform