Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy to delimited ?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00225005
Message ID:
00225039
Vues:
46
>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform