Page 1 of 1 1
Topic Options
#203969 - 2011-12-20 02:44 PM Multiple users for mapped drive
sparkie Offline
Getting the hang of it

Registered: 2010-09-14
Posts: 92
Loc: UK
I'm using IF @USERID to map a drive for a individual but is there an 'AND' that I can use with the command to name several users to map to the same drive?

Thanks

Top
#203970 - 2011-12-20 02:53 PM Re: Multiple users for mapped drive [Re: sparkie]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4563
Loc: USA
I think you mean OR, maybe?

 Code:
if @userid="Fred" or @userid="Barney" or @userid="Wilma"
  ;dostuff
endif




Edited by Allen (2011-12-20 05:46 PM)
Edit Reason: fixed macro

Top
#203971 - 2011-12-20 03:08 PM Re: Multiple users for mapped drive [Re: Allen]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Or create a group and use the InGroup() function.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#203972 - 2011-12-20 05:11 PM Re: Multiple users for mapped drive [Re: Allen]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
 Originally Posted By: Allen
I think you mean OR, maybe?

 Code:
if @userid="Fred" or @userid="Barney" or userid="Wilma"
  ;dostuff
endif


Ja, can't see an AND working with @UserID. BTW, you missed an @ on "Wilma".
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#203973 - 2011-12-20 05:47 PM Re: Multiple users for mapped drive [Re: Les]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4563
Loc: USA
Good catch. Fixed.
Top
#203974 - 2011-12-20 08:08 PM Re: Multiple users for mapped drive [Re: Allen]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
What about Betty? \:\)

An alternative:
 Code:
$Users='~Fred~Wilma~Barney~Betty~'
If InStr($Users, '~' + @USERID + '~')
  Do stuff...
EndIf
Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#203975 - 2011-12-20 09:18 PM Re: Multiple users for mapped drive [Re: Glenn Barnas]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Or...
 Code:
$users='Fred','Wilma','Barney','Betty'
If AScan($users,@UserID)>=0
   Do stuff...
EndIf

Top
#203978 - 2011-12-21 09:01 AM Re: Multiple users for mapped drive [Re: ShaneEP]
sparkie Offline
Getting the hang of it

Registered: 2010-09-14
Posts: 92
Loc: UK
Cheers guys, plenty of options there to consider. \:\)
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 525 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.062 seconds in which 0.03 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org