> > There is too an else if. Just do else if(). Use it all over the
> > place. Never had a problem.
>
> How come the docs say you can only do else and place the if inside
> the else...
>
> I've done else if() before - as it's actually else { if() }
>
> I'll have to check with multiple else if()s
I don't know what the docs say, but CFSCRIPT code uses the same syntax as
JavaScript for if ... else:
if (condition) statement_to_execute else other_statement_to_execute;
Most developers are used to having curly brackets, but these are only needed
with blocks of code:
if (condition) {
statement_to_execute;
} else {
other_statement_to_execute;
}
Since an "if" construct is just a single statement, no curly brackets are
required for it, and are typically left off:
if (condition) {
} else if (othercondition) {
}
CFSCRIPT, because it follows JavaScript syntax, will also allow this.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists