Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Writing to Text file
Message
From
14/12/2013 08:34:31
 
 
To
14/12/2013 08:24:18
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01590155
Message ID:
01590231
Views:
57
>>That's not unexpected since VFP opens the file for every record, it was more to check the concept. Try this instead:
>>
>>Create Cursor BILLCOMPRESS (PS C(254))
>>Append From (m.CPSFILEPATH) Sdf
>>lcText=''
>>scan
>>   lcText = lcText + trim(ps)
>>Endscan
>>Strtofile(lcText,newpath)
>
>Yuck - if Len(lcText) grows much beyond 2**16 you will hamper vfp heavily by forcing to allocate new memory. Turn to LLF instead, more stable overall.

No problem, I actually agree with you. The thing is that it's been a long time since I used the low level file functions, so I just wrote down a few lines from memory. This should be the fastest and overall best solution, I hope you agree.
lnHandle = fcreate(newpath)
scan
   fwrite(lnHandle,trim(ps))
Endscan
fclose(lnHandle)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform