Page 1 of 1 1
Topic Options
#203889 - 2011-12-06 10:55 PM newbie question !
cividan Offline
Fresh Scripter

Registered: 2011-11-18
Posts: 25
Loc: Quebec, Canada
I want to do a simple if to check if member of group1 or member of group2

there is probably a syntax to do the OR check but I just can't find it.
 Code:
If InGroup("group1") or If InGroup("group2")

use M: 

endif 


will that work ? or do I have to put a special syntax ?

Top
#203890 - 2011-12-06 11:01 PM Re: newbie question ! [Re: cividan]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4563
Loc: USA
I like my code to be readable so I like to use ingroup like the following.
 Code:
If InGroup("group1") or InGroup("group2")
  use M: 
endif 


However, ingroup supports mulitple groups, here are some other examples:

 Code:
If InGroup("Developers", "Testers") = 1
   ? "Member of Developers OR Testers group"
EndIf

If InGroup("Developers", "Testers", 1) = 1
   ? "Member of Developers AND Testers group"
EndIf

$Array = "Developers", "Testers"
If InGroup($Array, 1) = 1
   ? "Member of Developers AND Testers group"
EndIf

Top
#203894 - 2011-12-07 04:08 PM Re: newbie question ! [Re: Allen]
cividan Offline
Fresh Scripter

Registered: 2011-11-18
Posts: 25
Loc: Quebec, Canada
Thanks alot, I learning something again today !
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 1.876 seconds in which 1.761 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