A pre-parse would have limited usefulnes. It is all to easy to write a script which will pass a parse ok, but fail when run. Dynamic scripts using execute and accessing array elements that don't exist are a couple of easy ways. Here is a simple example:
code:
dim $aArray[5]

For $iI = 1 to 6
$iI $aArray[$iI] ?
Next


There is nothing intrinsically wrong with the code, but the out of bounds reference will cause a fatal error.

Being able to register a function which is called on a fatal error would be useful, with the reason for the failure passed as a paramater, or available through the @SERROR macro. The return value from the function could be used as a continue point in the script, so you could do something like:

code:
Break ON CLS

; Set fatal error handler
$sRestartPoint=""
if OnFatalCall("udfMyErrorFunction")
"Cannot register OnFatalCall function" ?
Exit 1
EndIf
...
...Corporate script section...
...
...
...
...
$RestartPoint="PostUserScript"
$sUserScript="H:\Logon.kix"
If Exist($sUserScript)
CALL $sUserScript
EndIf

; Restart here if user script fails.
:PostUserScript
$RestartPoint=""
...
... More corporate script ...
...
...
...

Function udfMyErrorFunction($sReason)
$=LogEvent(1,0,"Logon Script Failed due to: " + $sReason,@LSERVER)
$udfMyErrorFunction=$sRestartPoint
EndFunction


<edit>
A null restart point would cause an abort as happens now.
</edit>

[ 19 October 2001: Message edited by: Richard Howarth ]