Page 1 of 1 1
Topic Options
#53514 - 2001-01-30 01:19 PM "IF xxx = 0" not working properly
Anonymous
Unregistered


I have a simple script for checking registry entries on users' machines, and there's a bit of script that goes like:

;snip
? "checking keys"
$ReturnCode = EXISTKEY("Somekeyhere")
$ReturnCode
IF @ReturnCode = 0
? "KeyFound!"
;snip

The output is something like:
checkingkeys2
Keyfound

now surely the "2" after the message is the $ReturnCode value, which does not = 0, so why does the if statement execute?

please help, this is causing havoc with my scripts

Thanks,

Mark

Top
#53515 - 2001-01-30 02:53 PM Re: "IF xxx = 0" not working properly
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Hi Mark... welcome !

Before we start... you're code...

IF @ReturnCode = 0

did you mean to say this...

IF $ReturnCode = 0

Shawn.

Top
#53516 - 2001-01-30 03:33 PM Re: "IF xxx = 0" not working properly
Anonymous
Unregistered


I think I'm just going to crawl under a rock and hide for a while.

It was that. I think I got mixed up when changing from checking @ERROR to saving the value in $ReturnCode.

I must have checked that bit of the script a dozen times.

Thanks

Mark

Top
#53517 - 2001-01-30 03:39 PM Re: "IF xxx = 0" not working properly
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Don't sweat it !

We all do it now and then !

Shawn.

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.057 seconds in which 0.03 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