Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
File problem
Message
 
À
04/07/2003 09:30:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00806936
Message ID:
00807262
Vues:
23
>This is my code
>===============
>SELECT rapport
>COPY TO "export.csv" TYPE DELIMITED WITH "" WITH CHARACTER "|"
>IF FILE('export.csv') && Does file exist?
>gnErrFile = FOPEN('export.csv',12) && If so, open read-write
>ENDIF
>lfield = ""
>FOR gnCount = 1 TO (FCOUNT( ) - 1) && Loop for number of fields
>lfield = lfield + FIELD(gnCount) + "|"
>NEXT
>lfield = lfield + FIELD(gnCount) + CHR(13)
>=FWRITE(gnErrFile, lfield )
>=FCLOSE(gnErrFile)

>ODDEVEN|CODE|OFFNAME|TEL1|TEL2|FAX|WEB|EMAIL(there i got a little square)
>|604-856-0422|www.sample.com|info@sample.com

>but it doest make chariage return
>how can i do

Try this:
IF FILE('export.csv') && Does file exist?
   gnErrFile = FOPEN('export.csv',12) && If so, open read-write
   IF gnErrFile > 0 && ot use FERROR function here
     lfield = ""
     FOR gnCount = 1 TO (FCOUNT( )-1) && Loop for number of fields
      lfield = lfield + FIELD(gnCount) + "|"
     NEXT
   ENDIF
ENDIF
lfield = lfield + FIELD(gnCount) + CHR(13)+CHR(10)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform