Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with Set Alternate to File
Message
De
26/09/2010 23:44:36
 
 
À
26/09/2010 23:16:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01482806
Message ID:
01482808
Vues:
55
>I'm trying to use Set Alternate to capture some ? output in my prg.
>
>Set Alternate On
>Set Alternate To C:\Temp\001.txt
>
>run a prg
>
>Set Alternate Off
>Set Alternate To
>Modi Comm C:\Temp\003.txt
>
>
>It opens the file, but it is mostly empty, except for a few characters on the first line.
>
>It has a space and what looks like an arrow pointing the right.
>
>What in the world am I possibly doing wrong?
>
>VFP9SP2, Win 7, 64-bit

In some of my programs I use the following:
* Update system log file:
SET ALTERNATE TO (This.DSEXEFolder + [SystemLog.TXT]) ADDITIVE
SET ALTERNATE ON
SET CONSOLE OFF

?tcMessage

SET CONSOLE ON
SET ALTERNATE OFF
SET ALTERNATE TO
The above writes a single line/message to a log file. If you call it more than once you need ADDITIVE, otherwise previous contents are overwritten.

It so happens I'm refactoring some of this code; I'm considering replacing the above with STRTOFILE( ..., 1 ).
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform