Ok, I over did the sample script a bit - I just can't help showing off

You only need to include the function, so put this (very short) function in your script somewhere:

code:
FUNCTION SetError($ErrorNumber) exit $ErrorNumber ENDFUNCTION

Then whenever you want to do the check, rather than
@ERROR=<some value>
you'd put
SetError(<some value> )

------------------
Richard Howarth