Solved

ColdFusion compare variable to a list - cfif statement

Posted on 2009-04-08
2
516 Views
Last Modified: 2012-05-07
Hi, I have a variable that I want to compare to a list, and if it matches on of the values, then I want to display something.  I don't remember the right way to do this.

Basically, I want this:

<CFIF #value# in (1,2,3)>go</cfif>
0
Comment
Question by:wkolasa
2 Comments
 
LVL 19

Accepted Solution

by:
erikTsomik earned 500 total points
ID: 24097975
try this
<cfset lList="1,2,3">
<cfif ListFindNoCase(lList,value) gt 0>
go
</cfif>
0
 

Author Closing Comment

by:wkolasa
ID: 31597481
Thank you.  Solution worked just as I needed.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now