Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help on FileToStr() and ChrTran() functions
Message
From
10/05/2001 07:45:25
 
 
To
10/05/2001 05:35:12
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00505649
Message ID:
00505667
Views:
23
>Hi
>
>I'm using these commands to get rid of the double quotes in a text flat file. The code works accept when the file contains more than +/- 2000 records (lines) the vfox session hangs (NOT RESPONDING). Is there a limit or do I need to include in my code a command that tells vfox to wait until the FileToStr command is done? Please help...
>
>The command that causes the programto hang is:
>StrToFile(chrtran(FileToStr('c:\tmp\wtbsold.txt'),'"',''),'c:\tmp\wtbsold.txt')
>
>Thank you
>
>Irene Grassow

I don't know the answer to this but...
It might be worth creating a variable in a intermediary step between the filetostr and the strtofile
I don't quite know where the file would be stored with the technique you have used, somewhere internally to Foxpro - maybe it's just too much for it to handle.
Try something like
lcStr = FileToStr('c:\tmp\wtbsold.txt')
StrToFile(chrtran(lcStr),'"',''),'c:\tmp\wtbsold.txt')
Foxpro's limits for string handling are pretty huge (on my machine 5,865,500 chars then it GPF's) so unless the file you are reading in is enormous this should work!
Will Jones
Previous
Reply
Map
View

Click here to load this message in the networking platform