Having trouble with findnocase and not sure I understand...I've inherited some code, never used the findnocase before.  In this scenario it is being used to only show information on the page if the person logged in has a role of developer, which is a value of 1.  This is the code:
<CFIF FINDNOCASE(1,#session.role#) GT 0> ... where session.role contains the string of roles for that user logged in.  The role could be a single digit (like 1) or a comma separated list (like 3,4,6,10).

Right now, it is showing on everyone's page.
Lee R Liddick JrReporting AnalystAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Brijesh ChauhanStaff IT EngineerCommented:
FINDNOCASE either returns the position of the search string or zero if it is not able to find the string, if your session.role is a list then you can replace the above with listFind function as below..

<cfif listFind(session.role,1)>

if the role list contains 1, it would go inside the cfif condition otherwise not.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Lee R Liddick JrReporting AnalystAuthor Commented:
Thank you B...understood.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.