On Thu, Feb 11, 2010 at 1:12 PM, Jason King <[email protected]> wrote:
> I tried this as well, and it generated a Server 500 Error, too.
>
> <cfset variables.hit[x] = variables.hit[x] + 1/>
>
There must be something else going on with your code, or variables.hit[x]
isn't a valid data type at the point at which you're doing the addition
operation. I'd remove the addition and just dump or output variables.hit[x]
in your loop (I'm assuming you're in a loop) to see what's going on.
I just tested that syntax as follows and it works fine:
<cfset variables.foo = [1,2,3,4,5,6,7,8,9,10] />
<cfloop index="i" from="1" to="#ArrayLen(variables.foo)#">
<cfset variables.foo[i] = variables.foo[i] + 1 />
</cfloop>
<cfdump var="#variables.foo#" />
If you're on 1.2 stable note that the first line won't work since the
implicit array notation was added later, so you'd have to adjust the array
creation accordingly to test.
--
Matthew Woodward
[email protected]
http://blog.mattwoodward.com
identi.ca/Twitter: @mpwoodward
Please do not send me proprietary file formats such as Word, PowerPoint,
etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html
--
Open BlueDragon Public Mailing List
http://www.openbluedragon.org/ http://twitter.com/OpenBlueDragon
mailing list - http://groups.google.com/group/openbd?hl=en
!! save a network - please trim replies before posting !!