I have a problem handling errors in AutoIt. What I want to do is avoid the typical -1 error message.
1.
how do you handle it generally, so that error message doesn't appear ?
2. This is how I check for RoadRunner to avoid errors when using the RoadRunner object.
Code:
Func _rr_getinfo($info)
if not WinExists("RideRunner") and not WinExists("RoadRunner") then exit
if not ProcessExists("RideRunner.exe") and not ProcessExists("RoadRunner") then exit
if IsObj($rr) then
return $rr.getinfo($info)
else
exit
endif
EndFunc
Func _rr_execute($command)
if not WinExists("RideRunner") and not WinExists("RoadRunner") then exit
if not ProcessExists("RideRunner.exe") and not ProcessExists("RoadRunner") then exit
if IsObj($rr) then
$rr.execute($command)
else
exit
endif
return
EndFunc
As you can see it's a little complicated, because I tried to catch every eventuality. Still I sometimes get an object error.
Why ? How do I fix this ?