Oops, my bad! I'm not calling the function without arguments, but with an argument that has nog been declared yet. Below some relevant code.

In short, here's the contents of a batchfile that *SHOULD* be called with 2 arguments.

Code:

@echo off
kix32.exe script.kix $KG=%1 $CLIENT=%2



In script.kix I have the following code.
Code:

If CheckClient($CLIENT)=1
Goto ClientOk
Else
Goto ErrorMessage
EndIf



This works well if the batchfile is called with 2 arguments. These arguments are then passed to the Kix script as $KG and $CLIENT. However, if the batchfile is called without arguments, my function CheckClient still returns 1.

Hope to have clarified things a bit. I have removed the dim statement. Better code , but it still does not solve my problem.