Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help on FileToStr() and ChrTran() functions
Message
 
 
À
10/05/2001 05:35:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00505649
Message ID:
00505680
Vues:
17
>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')

I know Steven Black has demonstrated an example of string handling on the book War and Piece [or some similar enormous book]. I think you r problem is you are trying to do too much in one command. Break it up into several commands:

lcFileName = GetFile()
lcString = FileToStr(lcFileName)
lcString = chrtran(lcString, '"', '')
lnRetval = StrToFile(lcString, lcFileName)

That is much more maintainable code, and costs you nothing performance-wise.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform