Excerpt from the manual :

quote:
Exit

Action: Exits the current KiXtart script, or, if used at the topmost level, exits KiXtart.

Syntax: EXIT [error level / exit code]

Remarks: If EXIT is followed by a numeric expression, then @ERROR is set to the value of that expression and you can check it in the calling script or batch file.


Exit as is tries to get the next statement as error condition , so if this is an else or an endif it might happen that the parser ignores this and continues in the subsequent (Just a guess as I don't exactly know what happens)

However, some of us (including me) code an exit statement where nothing is needed to return as

exit()

Some place for confusion as exit is a command and not a function [Wink] , but it then exits as you supposed without continuing or setting @error

hth
_________________________