|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Array displaying 'Yes'???
I built an array on my page that works almost perfectly for what I need it for. It loops through my query and finds the correct results, but it also displays 'Yes' each time it returns a 'true.' This displays above my table where I'm using it. Any clues? It may be something easy but I don't have any experience with arrays so I'm clueless.
<cfset apprarray = arraynew(1)> <cfoutput query="GetAppr"> <cfset appvar = 'false'> <cfset varto=arraylen(apprarray)> <cfloop from="1" to="#varto#" index="i"> <cfif getappr.classificationid is apprarray[i]> <cfset appvar = 'true'> </cfif> </cfloop> <cfif appvar is 'false'> #arrayappend(apprarray,getappr.classificationid)# </cfif> </cfoutput> |
|
#2
|
|||
|
|||
|
It appears the yes is actually coming from the line where appvar is false:
<cfif appvar is 'false'> #arrayappend(apprarray,getappr.classificationid)# </cfif> Will output the return value of the arrayAppend function (which is true or YES). replace your #arrayAppend... with a CFSET and that should do it. Just use a temporary variable or no variable, like below <cfset arrayappend(apprarray,getappr.classificationid)> |
|
#3
|
|||
|
|||
|
That worked! Thanks so much, I appreciate it.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Array displaying 'Yes'??? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|