Ian Winter Ian Winter

ColdFusion structure Bug

Found a new bug today in Coldfusion 7. Basically if you create structure via arguments and try to use it later you'll notice some funky behaviour and the meta information about the structure is incorrect. Code test case is included.

<cfscript>
function struct() { return arguments; } </cfscript>

<cfset s = struct(arg1="blahblah", arg2="cont", arg3="act")>

<cfoutput>
<h3>#s.getClass()#</h3>
length: #structcount(s)# (#structkeylist(s)#)<br>
<cfset structdelete(s, 'arg1')>
length: #structcount(s)# (#structkeylist(s)#)<br>
<cfset structdelete(s, 'arg2')>
length: #structcount(s)# (#structkeylist(s)#) </cfoutput>

<cfset s = structnew()>
<cfset s['arg1'] = "blahblah">
<cfset s['arg2'] = "cont">
<cfset s['arg3'] = "act">

<cfoutput>
<h3>#s.getClass()#</h3>
length: #structcount(s)# (#structkeylist(s)#)<br>
<cfset structdelete(s, 'arg1')>
length: #structcount(s)# (#structkeylist(s)#)<br>
<cfset structdelete(s, 'arg2')>
length: #structcount(s)# (#structkeylist(s)#) </cfoutput>

Comments

Powered by BlogCFC, 5.9.002. Contact Me

All comments, view, rants, raves and opinions are mine and mine alone.

del.icio.us Digg Flickr Last.fm LinkedIn Pownce Twitter YouTube