我正在尝试查找包含在数组中的结构的值。下图显示了表示:
我尝试了下面的代码,但它给了我这个错误,使用 CF 9.0.1
Element OPTIONTYPE_NAME is undefined in a CFML structure referenced as part of an expression.
我正在尝试的代码:
<cfif !ArrayIsEmpty(result)>
<cfset arrayIndex = 0>
<cfloop from="1" to="#ArrayLen(result)#" index="counter">
<cfif result[counter].OPTIONTYPE_NAME IS "color">
<cfset arrayIndex = counter>
<cfdump var="#arrayIndex#">
</cfif>
</cfloop>