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
Title:
Can VFP work with redirection pipes?
Miscellaneous
Thread ID:
00322102
Message ID:
00322102
Views:
63
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.

Is there anything equivalent in VFP? I suppose I could do something like the code below, but I was hoping to be able to do it without a TempFile.
Run DIR >c:\TempFile
lnFile=Fopen("C:\TempFile")
Do While Not FEOF(lnFile)
   lcOutPut=FGet(lnFile)
   ?lcOutPut 
EndDO
FClose(lnFile)
Erase "c:\TempFile"
I realize this example is useless, but the DIR was easy way to show what functionality I am looking for.

TIA
Alan Trosky
MIS Director
Pennsylvania Bar Association
Harrisburg PA 17108
Next
Reply
Map
View

Click here to load this message in the networking platform