Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Appending text to low level file
Message
From
01/07/1999 09:32:55
 
 
To
01/07/1999 09:24:10
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00236407
Message ID:
00236414
Views:
12
>Hello,
>I want to create a error log file, but I don't know how to write to a file without loosing the existing text.
>Is there a easy way to write "additive" to file?

If you use ?/?? for output to a file using SET PRINTER, you can:

SET PRINTER TO File name ADDITIVE
SET PRINTER ON

You can also use

SET ALTERNATE TO File Name ADDITIVE
SET ALTERNATE ON

to do the same thing

If you use low-level file I/O, you can use an FOPEN() if the file exists to open the file for output, and then immediately do an FSEEK() to get to the end of file, something like:

nFH = FOPEN('C:\Some\Text\File',12) && open read-write, buffered
=FSEEK(nFH,0,2) && Move to end of file
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform