tracker issue : CF-3036953

select a category, or use search below
(searches all categories and all time range)
Title:

Bug 73968:In ColdFusion 8, starting a variable with a currency symbols was allowed

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Todd Rafferty / Todd Rafferty (Todd Rafferty)

Created: 12/03/2008

Components: Language, Functions

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 / 223732

Priority/Frequency: Normal / Most users will encounter

Locale/System: English / Platforms All

Vote Count: 1

Problem:

In ColdFusion 8, starting a variable with a currency symbols was allowed. In the beta of CF8, I reported that there are still some issues where this is failing and I felt as if it was only half implemented. 

I can't find the old bug note, so I'm drafting a new one.
Method:

<h2>Valid</h2>
<cfset $test = {stuff=1,stuff2=2,stuff3=3}>
<cfdump var="#$test#">
<hr />
<h2>Throws error</h2>
<cfloop index="$stuff" from="1" to="20" step="1">
<cfoutput>#$stuff#</cfoutput>
</cfloop>
Result:

 Attribute validation error for CFLOOP.
The value of the INDEX attribute is invalid. Cannot set variable with name $stuff.The variable name is illegal. Variable names must start with a letter and can include only letters, numbers and underscores.
 
The error occurred in C:\Dev\websites\testbed\test\test.cfm: line 4

2 : <cfdump var="#$test#">
3 : <hr />
4 : <cfloop index="$stuff" from="1" to="20" step="1">
5 : <cfoutput>#$stuff#</cfoutput>
6 : </cfloop>

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3036953

External Customer Info:
External Company:  
External Customer Name: Todd Rafferty
External Customer Email: 65E3269B4558959A992016B6
External Test Config: 12/03/2008

Attachments:

Comments:

Additional note - Declaring $stuff ahead of time does not provide a workaround: <cfset $stuff = 0> <cfloop index="$stuff" from="1" to="20" step="1"> <cfoutput>#$stuff#</cfoutput> </cfloop>
Vote by External U.
24514 | November 10, 2011 07:05:26 PM GMT