When you have some bad code that stops the KiX interpreter, it will put the error message on the console. The problem is that the console closes before you get to read the message.
The best way to troubleshoot and to get the message to stay on the console is to first open a DOS box. Then, from the DOS box, type the command to launch your test script.
One can also pass an ERRORLEVEL to the LOGON.BAT from within KiX. The KiX EXIT command supports a parameter which in fact should always be included. If KiX bombs before reaching the EXIT 0 then ERRORLEVEL will be set to 1 by the error.
The following bad code is used here as an example:
code:
break on
$RC = ReadirectOutput(These Are Not Valid Parameters)
Exit 0
It yeilds the following output:
code:
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.
C:\>C:\KiX\KIX32.EXE C:\KiXScripts\test.kix
Script error: expected expression!
$RC = ReadirectOutput(These Are Not Valid Parameters)
C:\>
THe following BAT file is used to demonstrate:
code:
@ECHO OFF
C:\KiX\kix32 C:\KiXScripts\test.kix
IF ERRORLEVEL 1 goto ERROR
IF ERRORLEVEL 0 goto DONE
:ERROR
ECHO ERROR HAS OCCURRED
pause
:DONE
CLS
EXIT
[ 19. January 2003, 03:51: Message edited by: LLigetfa ]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.