Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with Set Alternate to File
Message
From
26/09/2010 23:44:36
Al Doman (Online)
M3 Enterprises Inc.
North Vancouver, British Columbia, Canada
 
 
To
26/09/2010 23:16:16
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01482806
Message ID:
01482808
Views:
56
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform