Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with Set Alternate to File
Message
From
26/09/2010 23:55:56
 
 
To
26/09/2010 23:44:36
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01482806
Message ID:
01482809
Views:
50
Well, I found that if I included the Set commands in the PRG, rather than trying to do it from the command window, it works just fine.

Before, I was issuing the Set commands in the command window, then I was running my prg from the command window, the I was clearing set set alternate at the command window after the prg ran.

Apparently, this was making it look like a separate instance or session or something... But as soon as I just added it all into my program, it works like it is supposed to.



>>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 ).
Previous
Reply
Map
View

Click here to load this message in the networking platform