Page 1 of 1 1
Topic Options
#51271 - 2000-08-31 10:30 PM Passing Command Line variables
Anonymous
Unregistered


When evaluating variables that are created at the command prompt, an "IF" statement will returned a value of true if the variable is undefined (has a value of unknown or 0).

Here is some simple test code I used;
IF ($Prompt = "Yes")
? $Prompt" = Yes" ?
ELSE
? $Prompt" <> Yes" ?
ENDIF

If you run this code and forget to add the variable declaration on the command line the "IF" statement will evaluate to true. Does anyone have an idea about how to check for an undefined variable?

Top
#51272 - 2000-09-01 02:27 PM Re: Passing Command Line variables
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Mikey:

When I check for command line parameters, I usually double qualify my if expression like this ...

IF $Prompt and $Prompt = "Yes"
? $Prompt" = Yes" ?
ELSE
? $Prompt" <> Yes" ?
ENDIF

I think this version might perform more as expected.

As well, there is some "funkyness" to the way KiX processes command line arguments, so beware ...

See these threads, especially the observation that specifying just "$parm" on the command line, then using this variable in a string expression, cause KiX32 to enter an infinite loop !

Break On !

http://kixtart.org/board/Forum1/HTML/000924.html

http://kixtart.org/board/Forum1/HTML/000929.html


Shawn.

[This message has been edited by Shawn (edited 01 September 2000).]

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.052 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org