Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can VFP work with redirection pipes?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00322102
Message ID:
00322118
Views:
24
>With the language I use to work with (BBX), you could open a file handle to an external program and return the standard output of that command with each read. An example would be:
>
>10 Open(1)"|DIR"
>20 Read(1)a$
>30 Print a$
>40 Goto 20
>
>By using the Pipe symbol as the first character of the file to be opened, it created a link to the file handle. Each Read of that channel would return one line of standard output from the DIR commnad.
>

Looks a whole lot like old MBASIC (or any other pre-visual BASIC)...

No - VFP does not use STDIN/STDOUT in that fashion; it's not a console app. You can open a file by name and read/write it a line at a time using low-level file I/O (FGETS() reads a file a line at a time to the line terminator, EOF or maximum line lngth specified, FPUTS() writes a line at a time with a line terminator.) You can do the STDIN/STDOUT stuff easily enough using VBScript or JScript and if VFP really is needed in all of this, the script language can instance a VFP COM object and pass stuff line at a time or whatever to VFP via COM. The script stuff should be tiny and unless you need all the database processing of VFP directly, you need not even use a VFP COM object if all that's neeed is to write stuff into a table.
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