[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 544
  • Last Modified:

ColdFusion compare variable to a list - cfif statement

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
wkolasa
Asked:
wkolasa
1 Solution
 
erikTsomikSystem Architect, CF programmer Commented:
try this
<cfset lList="1,2,3">
<cfif ListFindNoCase(lList,value) gt 0>
go
</cfif>
0
 
wkolasaAuthor Commented:
Thank you.  Solution worked just as I needed.
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now