Previous Topic: OSRedirect.receivedResult MethodNext Topic: RemoteTarget Class


OSRedirect.result Method

Child processes produce three types of result information. The regular output typically written to the screen, error output typically written to the screen, and a final exit code ("errorlevel").

This method has the following syntax:

result()

This method returns the child process exit code.

Example

On Windows ping sets the exit code to 0 if the specified host responded otherwise to 1. Check and display result:

!! ping ascli1
if($$stdout.result()==0)
    ? "Ping successful"
else
    ? "Ping failed"

Note: An application-specific failure does not cause the errorOccurred() flag of OSRedirect() to be set.

See also:

OSRedirect.output Method

! Command--Invoke Command or Child Process (Cmdlet)

!! Command--Invoke Command or Child Process and Auto-capture Output (Cmdlet)