Page 1 of 1 1
Topic Options
#2767 - 2000-05-04 01:25 PM Less Than Operator not working
Anonymous
Unregistered


Why does the less than (< ) operator work in Kix 3.62??
I am reading a value from the registry and
then using an If statement to find if the
value is less than 2048 MB. If the condition
is true, the registry value is updated.

Here is the portion of the script:

$LOGMAXSIZE=READVALUE("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application","MaxSize")

$SETMAXSIZE=2097152

If $LOGMAXSIZE>$SETMAXSIZE

WRITEVALUE("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application","MaxSize","2097152","REG_DWORD")

EndIf

With the less than operator, the WRITEVALUE command is never initiated. Changing to the greater than operator runs the WRITEVALUE command whether the argument is true or not.

Please let me know if there is an answer.
Thank you.

Top
#2768 - 2000-05-04 04:19 PM Re: Less Than Operator not working
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
In kixtart you have to watch out for data declaration types. Unfortunately there is no way to explicitly declare a variable to be a string variable versus a numeric variable. Kixtart seems to implicitly take its declaration from the 1st use of the variable. From that point on the type is fixed. I bet one side of your test is declared as string & the other as a numeric.
_________________________
Jack

Top
#2769 - 2000-05-04 04:40 PM Re: Less Than Operator not working
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
try this

$LOGMAXSIZE=VAL(READVALUE("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application","MaxSize"))

Bryce

Top
#2770 - 2000-05-11 01:13 PM Re: Less Than Operator not working
Anonymous
Unregistered


Thank you both for the information. The inclusion of the VAL command has resolved my problem! On with the scripting!
Top
Page 1 of 1 1


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

Who's Online
0 registered and 1077 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.05 seconds in which 0.024 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