- Feb
- 53
- 1
Hello,
I just trashed a few dozen files because TakeCommand would happily continue after an IFF statement with a syntax error. Damm.
Anyway, that brings me to the question: Is there an easy option which tells TakeCommand to stop execution of a script after an syntax error?
Up until know I used:
This will end execution on most errors but leaves you without a useful error message and is a mouthful of code to type in. And this time I forgot to copy paste it.
Martin
I just trashed a few dozen files because TakeCommand would happily continue after an IFF statement with a syntax error. Damm.
Anyway, that brings me to the question: Is there an easy option which tells TakeCommand to stop execution of a script after an syntax error?
Up until know I used:
Code:
SETLOCAL
ON BREAK GOTO Catch
ON ERROR GOTO Catch
ON CONDITION ERRORLEVEL NE 0 GOTO Catch
…
ENDLOCAL
QUIT 0
:Catch
ON CONDITION
ON BREAK
ON ERROR
ECHO External Error: %[_?]: %@ErrText[%_?]
ECHO System Error: %[_SYSERR]: %@ErrText[%_SYSERR]
ENDLOCAL
CANCEL 1
This will end execution on most errors but leaves you without a useful error message and is a mouthful of code to type in. And this time I forgot to copy paste it.
Martin