Hi all,
I am trying to create a cfset statement which will set a dynamically named three dimensional array to a query value. the code I have created is:
to create the arrays
<cfloop index="z" from="1" to="#get_pack_size.recordcount#">
<cfparam name='#Evaluate(DE("pack_array_" & z))#' default="">
<cfset "#Evaluate(de("pack_array_" & z))#" = ArrayNew(3)>
</cfloop>
to fill them
<cfloop query="get_pack_size">
<cfset i = i + 1 >
<cfset curr_array=Evaluate(de('pack_array_'&i))>
<cfset "#evaluate(curr_array&'['&i&'][1][1]')#" = get_pack_size.pack_size>
I get this error message
"The element at position 1 in dimension 3 of object "pack_array_1" cannot be found. That dimension of the object is empty. Please,
modify the index expression."
it seems like it's trying to set the value of the array as the dynamic variable name rather than the array
ie (the value of pack_array_1[1][1][1]) = get_pack_size.pack_size
rather than
pack_array_1[1][1][1]= get_pack_size.pack_size
any ideas?
Chris Sorel
chris@exnihilo.com
Remember, If you continue to do what you have always done,
you will continue to get what you have always gotten.
I am trying to create a cfset statement which will set a dynamically named three dimensional array to a query value. the code I have created is:
to create the arrays
<cfloop index="z" from="1" to="#get_pack_size.recordcount#">
<cfparam name='#Evaluate(DE("pack_array_" & z))#' default="">
<cfset "#Evaluate(de("pack_array_" & z))#" = ArrayNew(3)>
</cfloop>
to fill them
<cfloop query="get_pack_size">
<cfset i = i + 1 >
<cfset curr_array=Evaluate(de('pack_array_'&i))>
<cfset "#evaluate(curr_array&'['&i&'][1][1]')#" = get_pack_size.pack_size>
I get this error message
"The element at position 1 in dimension 3 of object "pack_array_1" cannot be found. That dimension of the object is empty. Please,
modify the index expression."
it seems like it's trying to set the value of the array as the dynamic variable name rather than the array
ie (the value of pack_array_1[1][1][1]) = get_pack_size.pack_size
rather than
pack_array_1[1][1][1]= get_pack_size.pack_size
any ideas?
Chris Sorel
chris@exnihilo.com
Remember, If you continue to do what you have always done,
you will continue to get what you have always gotten.