Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
More control in a .txt
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01490543
Message ID:
01490579
Vues:
46
>Thanks Hilmar
>
>I was sucessful to write to lines, but I think I have a problem in arrange SCAN command
>and variable because only the last record is written to the .txt.
>
>
>
>SELECT nota
>
> SCAN
>
> nfe = "E" +"|" + ALLTRIM(cl ) + "|IE|ISUF|" + CHR(13) + CHR(10)
>nfe = nfe + "E02|CNPJ" + CHR(13) + CHR(10)
>
>
>nfe = nfe + "E05|XLgr|Nro|XCpl|XBairro|CMun|XMun|UF|CEP|CPais|XPai" + CHR(13) + CHR(10)
>
>
> ENDSCAN
>
> STRTOFILE(nfe, "nfe001.txt")

In your first SCAN you're not incrementing nfe, so you overwrite it every time. BTW, it will be much faster if you write each line directly to the file rather than construct one long string first. Just use 1 as last parameter in StrToFile function to append to the existing file.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform