<cfset currentRoles = "1,2,4,6,9">
<cfloop list="#currentRoles#" item="role">
<cfloop from="1" to="#ArrayLen(Element1)#" index="x">
<cfloop from="1" to="#ArrayLen(Element2)#" index="y">
<cfif ( role eq Element1(x) ) and ( role eq Element2(y) )>
<!--- Code to remove the user from the invalid role --->
<cfbreak>
</cfif>
</cfloop>
</cfloop>
</cfloop>
________________________________
From: Casey C Cook [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 23, 2004 4:26 PM
To: CF-Talk
Subject: Comparing a list against an 2 element array?
This request has blown me away, I cant get my hands around it. The current
user roles lists all the roles the user is in. The 2 element array is
combinations of roles which are not allowed. The end result is the user
will be removed from the roles which conflict. I dont really know where to
start on this one. Has anyone done anything like this or know where to
look? please see below.
Current User roles
1
2
4
6
9
Invalid Combinations
Element1 Element2
1 2
2 1
3 3
4 6
5 7
9 8
So, if I look at the data the user is currently in 3 invalid combinations
of roles. (1 and 2) (2 and 1) and (4 and 6)
Thanks,
Casey Cook
________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

