SYS(31) Returns Error Code from RUN Command

ID: Q120593

The information in this article applies to:

SUMMARY

In FoxPro for UNIX, the SYS(31) function returns the error code produced by a RUN command if the RUN command failed and a 0 if the RUN command was successful.

MORE INFORMATION

In the Command window, type the following:

   RUN xxx
   ?SYS(31)

Since the RUN command failed, SYS(31) returns a "1".

In the Command window, type the following:

   RUN ls
   ?SYS(31)

Since the RUN command was successful, SYS(31) returns a "0".

NOTE: An exclamation point (!) can be substituted for the keyword "RUN".

REFERENCES

FoxPro for UNIX online Help

Additional reference words: FoxUnix 2.60 sys return exit code run KBCategory: kbprg KBSubcategory:

Last Reviewed: August 28, 1995