Hi Richard and Glenn!
Thanks!
At first a question: doesn't
 Code:
$RC=Execute("Exit 0")
exit the script? Yes, I checked it out. So why doesn't the script exit???
Maybe I should illustrate the situation, in which I need this handling. I call a function which needs to check @error for its return value. This function is called within a while loop:
 Code:
;-------------------
function pingable
shell "cmd /c ping " + $machine + " >NUL"
if @error=0
  $pingable='yes'
else
  $pingable='no'
endif
cd "." ;reset @error regardless of value od $pingable
endfunction
;-------------------

...

while @error=0
...
$rc = pingable($machine)
;something like next machine
...
loop


As I presumed that @error is kind of global I thought I have to reset it to zero when leaving the function. Regarding your answers must that be wrong?
Regards, Roman


Edited by RomanB (2007-10-09 05:49 PM)
Edit Reason: wrong line in post, sorry