Shell.ExitCode

From Xojo Documentation

Property (As Integer )
aShell.ExitCode = newIntegerValue
or
IntegerValue = aShell.ExitCode

New in 2019r2

Supported for all project types and targets.

The exit code returned by the shell.

Notes

It returns 0 if the Execute method was executed successfully. Otherwise, it returns a system-supplied exit code. On Windows, it returns -1 if execution fails.

Example

This example checks the value of exit code and prints it if it is not zero.

Var sh As New Shell

sh.Backend = TextField1.Value
sh.Arguments = TextField2.Value
sh.Execute TextField3.Value
TextArea1.Value = sh.Result
If sh.ExitCode <> 0 Then
MessageBox("The exit code is: " + sh.ExitCode.ToString)
End If