I want this code to be executed if the array s does not contain the element in curr variable. How do I need to modify the if condition?
<cfif s.contains(#curr#)>
<cfset ArrayAppend(s,curr)>
<cfset en++>
<cfset cl=en-st>
</cfif>
I want this code to be executed if the array s does not contain the element in curr variable. How do I need to modify the if condition?
<cfif s.contains(#curr#)>
<cfset ArrayAppend(s,curr)>
<cfset en++>
<cfset cl=en-st>
</cfif>
The function you want is ArrayFind. Documentation is here ==> https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-a-b/arrayfind.html
You want something like this: