Hi all,
This code returns me an error code number 1 while it works well by default if I don’t set the error handling! is this a bug or is there really an error somewhere?
Shell1.Execute ("/usr/sbin/spctl --status")
If Shell1.ErrorCode = 0 Then
ud = Shell1.ReadAll
msgbox(ud)
else
MsgBox("An Error " + Shell1.ErrorCode.ToString +" has occurred !")
End
Hi,
Best practice is to store the error code into a variable and use the variable everywhere. It’s fairly possible the ErrorCode is a computed property and resets itself or changes each time you access it.
Does this make a difference in your case?
No, this is the only command that returns an error code among a dozen Shell commands that follow each other… and it’s still the same error code number 1.
(ExitCode) Already tried and no effect.
I succeeded by putting it in 1st position and the other Shell.Execute behind, and there it works! (probably a conflict)
try this in a method or so.
make sure you use what xojo advices you to use.
Result As String is what you need to get the entire result when mode is Synchronous