Meaning of shell.errorcode = -2

I wrote a ConsoleApp that I call in a shell. It has a mutex and timer that tries to enter the mutex five times. If it fails to enter, it prints “Busy” and exits with Quit(0). It works fine in the debugger - a command window opens and Busy appears a few seconds later. When I compile it and call it in a shell from another program, it returns an error code of -2 so I never get the shell result (“Busy”). The Language Reference says that Windows will return an error code of -1 if execution fails. MSDN lists thousands of error codes, but all are positive numbers. -2 must have a special meaning in Xojo.

I believe that under Windows, -2 is a shell timeout. Try increasing the shell’s timeout (default is 2 seconds.)

Thank you. That was it. It would be nice if the error codes were included in the Language Reference as they seem to be Xojo codes, not Windows errorlevels.

I don’t know that we would include a specific list of OS error codes, but I am happy to include a link to them. But I couldn’t easily find a list of Windows shell error levels. So if anyone has a link, let me know.