|
Problem with accessing array
Hi
Anyone give me a pointer this issue, its driving me nuts. Using coldfusion9. Here's the code with an 'issue', which I dont know how to resolve:
<cfset CheckCountry=Compare(#CountryNewsAggregator[arrayRowPointer][1]#,#Country#)>
The error CF is throwing back at me is:
Error Occurred While Processing Request
The element at position 1, of dimension 2, of an array object used as part of an expression, cannot be found.
It bassically doesnt like [arrayRowPointer]
If I dump arrayRowPointer out to the page, I get a number that I expect.
#Country# is from my query result and I've checked its coming back with a string.
the second dimension, shown as [1] above, is a virtual column where Im storing country names.
If I change the code to this, hardcoding the rownumber (bold):
<cfset CheckCountry=Compare(#CountryNewsAggregator[1][1]#,#Country#)>
CF seems happy. But that's no good for me, I'm in a cfloop and want to iterate through the row numbers in the array.
It seems like some kind of type conversion isnt working ? anyone have any ideas?
Thanks!
|