jtrainer
(Fresh Scripter)
2003-03-04 09:11 AM
if but not if... That is the question

Collective,

I need to test for two conditions.
First, if script see's a server, and is not Citrix (by name) then abort.

I have 2 variables:
IsServer = Yes
@Wksta = Citrix

I want to abort the script if IsServer = Yes, unless the @Wksta = Citrix. Perhaps I'm too tired now, but I can't get this to work. Hints / suggestions are completely welcome. [Smile]

Thanks
John


JochenAdministrator
(KiX Supporter)
2003-03-04 09:26 AM
Re: if but not if... That is the question



if $IsServer and not instr(@wksta,'Citrix';IsServer is in this case anything but empty or 0 !
    quit
endif



assimilate this [Big Grin]

[ 04. March 2003, 09:27: Message edited by: jpols ]


Richard H.Administrator
(KiX Supporter)
2003-03-04 09:27 AM
Re: if but not if... That is the question

Write it as you'd say it...
code:
If $IsServer="Yes" AND @WKSTA <> "Citrix"
...Do your funky thang...
EndIf



Richard H.Administrator
(KiX Supporter)
2003-03-04 09:28 AM
Re: if but not if... That is the question

Jochen, it looks like I'm doomed to follow you around the board this morning [Roll Eyes]

Must get a cup of coffee...


JochenAdministrator
(KiX Supporter)
2003-03-04 09:29 AM
Re: if but not if... That is the question

Yeah , got already my 4th [Razz]

NTDOCAdministrator
(KiX Master)
2003-03-04 09:31 AM
Re: if but not if... That is the question

Hi Jtrainer...

I'm not at work to really test this, but something like this should work.

As someone else comes online they may show you other code using the other macros of KiXtart 4.x

The use of the NOT operator requires you to be using KiXtart v4.x, but can be recoded if you're using v3.6x



$SRVR = ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions""ProductType")
IF $SRVR<>"WinNT" AND @Wksta NOT = "Citrix"
  QUIT
ENDIF



JochenAdministrator
(KiX Supporter)
2003-03-04 09:33 AM
Re: if but not if... That is the question

Good point Ron !

ALWAYS tend to forget that some people might still use 3.x [Roll Eyes]


NTDOCAdministrator
(KiX Master)
2003-03-04 09:33 AM
Re: if but not if... That is the question

Dang... clicked on MSN then came back and you guys jumped in line.

Hmmm.. I'm not a STARTERS Mod, so I can't boot your stuff. [Razz]

Oh well...


jtrainer
(Fresh Scripter)
2003-03-05 06:14 AM
Re: if but not if... That is the question

All, thanks.

As I said, I was pretty tired. I had the line working, yet as tired as I was, I forgot to replicate the updated code to the netlogon share. So as you may imagine it failed.

Yes I'm using 4.x, so I know it works with the NOT operator.

The code I had is the same as what Richard used. Again thanks.

BTW, did you know a rouge Exit aborts a script? He He I knew I was too tired to script a logon change last night.


JochenAdministrator
(KiX Supporter)
2003-03-05 08:18 AM
Re: if but not if... That is the question

yap, if stated at topmost level EXIT exits the script [Big Grin]

Richard H.Administrator
(KiX Supporter)
2003-03-05 09:39 AM
Re: if but not if... That is the question

quote:
BTW, did you know a rouge Exit aborts a script?
Yeah? I suggest you use the dusky umber Exit, it doesn't suffer from this problem.

[Wink]


Glenn BarnasAdministrator
(KiX Supporter)
2003-03-05 02:03 PM
Re: if but not if... That is the question

Dusky Umber? Is that Maybelline or Max Factor? Can't seem to find it here in the makeup drawer... [Wink] Maybe it's a rogue color?

G.


jtrainer
(Fresh Scripter)
2003-03-06 08:38 AM
Re: if but not if... That is the question

Dusky Umber, Isn't he the cousin of the Max Factor heir that was convicted of raping all those girls with the date rape drugs?