Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

More than 1 CFIF Argument

Status
Not open for further replies.

NetworkGhost

IS-IT--Management
Apr 12, 2005
1,324
US
<cfif isdefined("adm") AND #ADM# eq 1 or #ADM# eq 2>

Is this correct syntax?

Help is appreciated.
 
Close:
Code:
<cfif isdefined("adm") AND (ADM eq 1 OR ADM eq 2)>
There's actually several ways to do it, with or without pound signs, etc..., but that should give you what you want.


Hope This Helps!

ECAR
ECAR Technologies, LLC

"My work is a game, a very serious game." - M.C. Escher
 
hi NetworkGhost,

You are close, but there is no need for the extra pound signs(#) inside of your <cfif> statement. Good job with using the isDefined() function. If the variable doesn't exist, CF will short circuit your condition at that statement and save some processing time by ignoring the rest. It also prevent you from possibly "disovering bugs" in the application later on.

If you want to read a good document on correct ways to write your conditions, or when to use the proper tags, ect.. then you should check out "ColdFusion MX Coding Guidelines". It a well rounded document with suggestive techniques for following good practice, and writing efficient code.

ColdFusion MX Coding Guidelines (recently upated 4/14/2005)

hope this helps,

jalpino
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top