[thelist] CFMX problem - HTML output cut off - and character encoding

Jeff Howden jeff at jeffhowden.com
Wed Jul 16 03:55:11 CDT 2003


michael,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Buffington, Michael
>
> This works brilliantly in CF5, but all bets are off for
> prior versions:
>
> <cfset employee = StructNew()>
> <cfset StructInsert(employee, "firstname", "Tom")>
>
> <cfdump var="#employee#">
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

it's fine as far back as cf4.0.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> I'd also argue that cfset isn't just a tag used for
> assignment.  It simply, for lack of a better word,
> executes expressions. The following is perfectly valid,
> and works just fine in CF5 and up:
>
> <cfset 1 + 1>
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

sure, but the docs are very clear what the <cfset> tag is for.

  "Defines a ColdFusion variable. If the variable exists,
   this tag sets it to the specified value."

the fact that the parsing engine allows you to get sloppy with its usage
doesn't make it ok, in my book.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> The point is, the = symbol is simply an operator.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

actually, it's not an operator.  operators in cf are words; LTE, IS, EQ, GT,
XOR, etc.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> Sure, you get more results with <cfset var = something>,
> but it's no less valid, syntax-wise, to say
> <cfset 1 + 1>.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

based on the documentation, that is invalid, syntax wise because the results
of the expression are not being assigned to a variable.  granted, you're
correct that it won't throw an error, but that doesn't mean it shouldn't.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> I do, however, agree with you, to a degree. It just
> doesn't seem right, but it actually isn't incorrect,
> syntax-wise, performance-wise, or arguably
> readability-wise. It comes down to personal preference.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

well, imo, it's definitely a huge issue with regards to readability.  when
you're scanning code looking for where stuff is happening, a <cfset> tag
used "improperly" like this can easily slip through the cracks unnoticed.

.jeff

——————————————————————————————————————————————————————
Jeff Howden - Web Application Specialist
Résumé - http://jeffhowden.com/about/resume/
Code Library - http://evolt.jeffhowden.com/jeff/code/




More information about the thelist mailing list