Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
File problem (#2)
Message
De
04/07/2003 09:46:46
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
04/07/2003 09:36:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00806939
Message ID:
00806946
Vues:
17
Instead of if file(), you can test whether fopen() returns -1. This might also detect some other error situations.

After opening a file (successfully) with fopen(), use fgets() to get an individual line. fcount() and field() are not relevant for LLFF.

>NOw i found the solution i use FPUTS and it make my carriage return but when i write in the file it erase me character. How can i do if i dont want to lose character?
>
>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)
> =FPUTS(gnErrFile, lfield )
> =FCLOSE(gnErrFile)
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform