EDIT: Ok, I understand how to use EQ
and all that. I posted this in a bit
of a hurry. My question is about the
parentheses. Is it syntactically
correct to use them this way?
Syntactically, yes. The code's syntax is correct and will not throw syntax errors.
However, it's not necessarily the best way to do it. At the very least you should have linebreaks in there, to make it more readable, like so:
<cfif (not isdefined("URL.room") or URL.room EQ "")
and (not isdefined("URL.system" or URL.system EQ "")
and (not isdefined("URL.date") or URL.date EQ "")
>
And I would be more inclined to write it like this:
<cfif NOT
( ( isDefined('Url.Room') AND Len(Url.Room) )
OR ( isDefined('Url.System') AND Len(Url.System) )
OR ( isDefined('Url.Date') AND Len(Url.Date) )
)>
Because that's much more readable, and makes it more obvious that each row is checking the same thing.
That is assuming I was doing this in a single IF statement, anyway.
If you start getting lots of conditions to check, you might want to consider doing something like this instead:
<cfset FieldList = "Room,System,Date" />
<cfset AllFieldsValid = true />
<cfloop index="Field" list="#FieldList#">
<cfif NOT ( StructKeyExists(Url,Field) AND Len(Url[Field]) )>
<cfset AllFieldsValid = false />
<cfbreak/>
</cfif>
</cfloop>
<cfif AllFieldsValid>
...
Which might look intimidating at first, but is much easier to maintain - you just add a new item to FieldList (and you may already have a variable which serves that purporse).
Anyway, hopefully all this helps - let me know if any questions on it.