Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Executable handles files differently
Message
De
11/11/1999 12:47:48
 
 
À
03/11/1999 11:24:35
Thomas Ianuzzi
Information Security Consultants, Inc.
Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00285759
Message ID:
00290192
Vues:
19
That doesn't make a whole lot of sense. The STRTOFILE command should always write over top of any existing file, without your need to blank it first. If you want to append additional info using STRTOFILE you would set the third property to .T..

Say you have an existing file ABCD.TXT with the contents "This is a test". If you do a STRTOFILE("New information","ABCD.TXT") you would replace the contents and now only have "New information" in the file. If you do STRTOFILE("New information","ABCD.TXT",.T.) you'd end up with "This is a testNew information" as the files contents.

Maybe there's something strang about writing an empty string to the file first, but you don't need to do that anyways.

>Fred
>Your idea led me to an interesting discovery. When I run the executable the first STRTOFILE command is written to the file and all subsequent commands are ignored. The file was zero length because the first write to the file was an empty string used to clear out the file from the last use. It appears that I have to close the file between writes but I have'nt figured out the syntax for that yet
>
>Thanks for the help
>
>>>I have produced a file in an interactive FoxPro application with a series of STRTOFILE commands. It works fine, but When I build the application into an executable and run it, the file is still produced but it has zero length. Anyone have any experience with this
>>
>>Are you sure you're actually writing anything to the file? What does STRTOFILE return? It should return the number of bytes written to the file.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform