View Single Post
Old 05-21-2012, 08:02 PM   PM User | #1
mont2105
New to the CF scene

 
Join Date: May 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
mont2105 is an unknown quantity at this point
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!
mont2105 is offline   Reply With Quote