From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

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

New in 2019r2

Supported for all project types and targets.

The exit code returned by the shell.


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.


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

Var sh As New Shell

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