Page 1 of 1 1
Topic Options
#148287 - 2005-09-22 01:33 AM or operator question
cyri Offline
Getting the hang of it

Registered: 2005-06-27
Posts: 95
Probably a dumb question here, but is there something wrong with the below If statement?

Code:

$printserver="\\testserver"
$excl1="\\test01"
$excl2="\\test02"

$retcode=arrayenumkey('HKEY_CURRENT_USER\Printers\Connections\')
for each $printer in $retcode
$server=readvalue('HKEY_CURRENT_USER\Printers\Connections\' + $printer,"Server")
If $server <> $printserver Or $server <> $excl1 Or $server <> $excl2
? "test completed successfully"
Endif
Next



This part here isn't working. Even if $server = \\test01, it still goes through the If statement.
Code:
If $server <> $printserver Or $server <> $excl1 Or $server <> $excl2 



Edited by cyri (2005-09-22 01:36 AM)

Top
#148288 - 2005-09-22 01:43 AM Re: or operator question
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you want to have it with AND, not OR
_________________________
!

download KiXnet

Top
#148289 - 2005-09-22 01:47 AM Re: or operator question
cyri Offline
Getting the hang of it

Registered: 2005-06-27
Posts: 95
Thanks Jooel. It's been a long day.
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 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.061 seconds in which 0.032 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