Remove the first line:

SetConsole ("HIDE")

Try also to run it as KIX32 test.kix /d
and single step through the code. You may have fat fingered something in the code.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.