Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More control in a .txt
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01490543
Message ID:
01490579
Views:
45
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform