Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Writing to a text file
Message
From
18/08/1999 09:23:07
 
 
To
18/08/1999 08:46:39
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00254904
Message ID:
00254933
Views:
23
>I have to export data from a FoxPro database using VFP 6.0 in an unusual format to a text file. What commands can I use to send hard code as well as my data to the text file? I am currently trying:
>
>SET ALTERNATE ON
>SET ALTERNATE TO &lcfilename ADDITIVE
>??'RUNDATE: '
>??'OPERATOR: '
>
>at the beginning of my routine, and it's not working! Any ideas?
>
What do you mean by "it's not working"? Lots of things may be going wrong, including Windows interpreting the output as being sent to a printer and loading up graphical information.

You should avoid using macro expaqnsion IAC when specifying the name of a file for output - using name resolution will avoid problems created by Long File names that might be causing things on the comand line to be misparsed (frequently the case when the path contains a space.) Try the following instead of your SET ALTERNATE line:

SET ALTERNATE TO (lcFileName) ADDITIVE

It may not help, but it can't hurt.

You can look at using low-level file I/O, or build the output in a string memory variable, and then write that out as a file using STRTOFILE(). Both approaches never let Windows' printer driver at the file, so there's no chance of something funky going on as far as Windows converting the output to something other than what you want.
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
Reply
Map
View

Click here to load this message in the networking platform