Yes, having tried out a few more things with undefined variables in conditions, this is exactly what is happening. The $var="whatever" is taken as an assignment which returns TRUE if $var is undefined. This applies to IF statements as well as CASE. So the usual check that is made on command line variables to check they exist is not actually doing what we intuitively imagine.
code:
IF $var=""
? 'Usage: kix32 testcase $var="something"'
EXIT(1)
ENDIF
The $var="" is actually an assignment if $var is undefined so we could put anything in the quotes and it will still return true.I've sent something about this unexpected behaviour to rkinput@microsoft.com in case the Kixtart developers want to review the behaviour of undefined variables in conditions.
I suppose it's the ambiguity of the = operator that is avoided in languages which have different assignment and equality operators (e.g. = and ==).
Regards
------------------
Gerry Mulvenna, Applications Development Manager, Computing Services
Heriot-Watt University, Edinburgh, Scotland, EH14 4AS
www.mulvenna.demon.co.uk/gerry/ G.J.Mulvenna@hw.ac.uk
Tel: +44-(0)131-451 3794 Fax: +44-(0)131-451 3261