エラーが発生しました変数ARRAYCONTAINSは未定義です。私の構文に何が問題なのか分かりません。Arraycontains undefined coldfusion
はここに私のコードです:それは自己完結型の例があるので
<cfoutput>
<cfinvoke method="estimatedShipping" state="CA" returnvariable="days"/>
CA: #days#
<br>
</cfoutput>
<cffunction name="estimatedShipping" output="false" returntype="any">
<cfargument name="state" type="string" required="yes"/>
<cfset oneDayStates = ["CA"] >
<cfset twoDayStates = ["WA","OR","NV","ID","AZ", "UT"] >
<cfset threeDayStates = ["MT","WY","CO","NM"] >
<cfset fourDayStates = ["ND","SD","NE","KS","OK","TX","MN","IA","MO","AR","LA", "WI","MI","IL","IN","KY","TN","MS","AK","AL","GA","OH","WV"] >
<cfset fiveDayStates = ["ME","VT","NY","NH","MA","RI","CT","NJ","PA","MD","DE","VA","NC","SC","FL", "HI"] >
<cfif #arrayContains(oneDayStates, state)# eq 'YES'>
<cfset count = "1">
<cfelseif #arrayContains(twoDayStates, state)# eq 'YES'>
<cfset count = "2">
<cfelseif #arrayContains(threeDayStates, state)# eq 'YES'>
<cfset count = "3">
<cfelseif #arrayContains(fourDayStates, state)# eq 'YES'>
<cfset count = "4">
<cfelseif #arrayContains(fiveDayStates, state)# eq 'YES'>
<cfset count = "5">
<cfelse>
<cfset count = "5+">
</cfif>
<cfreturn count />
</cffunction>
使用しているColdFusionのバージョンは何ですか? ColdFusion 9では 'arrayContains'が導入されました。それ以外にも、条件文で'# 'を使って関数呼び出しをラップする必要はありません。 – Alex