|
Sometimes you want some information output by another application. For
example, to see which logical drives are mapped to SUBST drives, you can
do the following at the command prompt:
C:\>SUBST
This then lists the SUBST'ed drives and where they are mapped to.
To get this information in Xbase++, you would typically use the
RunShell() command with redirection to a file:
RunShell("SUBST > mappings.txt")
You can then read mappings.txt into a variable and analyse it.
This package contains a function called ShellOutputToBuffer(). What
this does is exactly the same as RunShell() except it redirects the
output of the external process back into an Xbase++ buffer. This buffer
is then emptied into a variable and returned to your calling
application.
e.g.
cBuffer := ShellOutputToBuffer("SUBST")
This function does not redirect to a file and then load the file into a variable.
It works by capturing the output of the external application.
|