Page 1 of 1 1
Topic Options
#78176 - 2001-07-24 02:32 PM bug???
pvds Offline
Hey THIS is FUN
*****

Registered: 2001-04-14
Posts: 201
I made a mistake but probably it is a bug?

used wkix32 -i

script

delprinterconnection ("\\server\xxxx1")
delprinterconnection ("\\server\xxx10")

if @wksta="xxxx1" or @wksta="xxxx2" or
addprinterconnection ("\\server\xxxx1")
setdefaultprinter ("\\server\xxxx1")
endif

if @wksta="xxx10" or @wksta="xxx11"
addprinterconnection ("\\server\xxx10")
setdefaultprinter ("\\server\xxx10")
endif

my fault is the second or, after te second @wksta, the result is that at ws xxx10 and xxx11 printer connection xxxx1 is also made.

GR P

Top
#78177 - 2001-07-24 02:49 PM Re: bug???
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
is your code really:
code:
if @wksta="xxxx1" or @wksta="xxxx2" or


when it should be
code:
if @wksta="xxxx1" or @wksta="xxxx2"

????


if it is that means:
"if workstation is 1 or 2 or printer can be connected set it as default."

[ 24 July 2001: Message edited by: Lonkero ]

_________________________
!

download KiXnet

Top
#78178 - 2001-07-24 03:14 PM Re: bug???
pvds Offline
Hey THIS is FUN
*****

Registered: 2001-04-14
Posts: 201
Yes my code was wrong and after i changed it everything is working fine. But the result with the wrong code supprised me.
Top
#78179 - 2001-10-14 06:13 AM Re: bug???
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

The script with the additional or did exactly what it has to do.

code:

IF condition1 OR condition2 OR condition3
setdefaultprinter(....)
ENDIF


can also be written as:
code:

IF condition1 OR
condition2 OR
condition3
setdefaultprinter(.....)
ENDIF


The condition3 is your addprinterconnection statement and it will
always be executed. Only the result of those three conditions will influence
the execution of your setdefaultprinter statement.
In many scripts you find code like:
code:

IF (AddPrinterConnection("\\domain\printer1") <> 0)
? "Warning KIX: @error (@serror)"
ENDIF


not only to show an error status but also to prevent error codes (= mostly 0's)
on your screen.

In other language f.e. pascal the IF/ENDIF structure knows a keyword then.
but this language doesn't have a clear endif statement.
So there is no bug in kixtart.
Greetings.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
Page 1 of 1 1


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

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

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