ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 13th, 2005, 07:57 AM
radone radone is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 12 radone User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 35 m 25 sec
Reputation Power: 0
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>

Reply With Quote
  #2  
Old January 13th, 2005, 08:15 AM
fortunato fortunato is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 33 fortunato User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 36 m 52 sec
Reputation Power: 4
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)>

Reply With Quote
  #3  
Old January 13th, 2005, 08:36 AM
radone radone is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 12 radone User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 35 m 25 sec
Reputation Power: 0
That worked! Thanks so much, I appreciate it.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Array displaying 'Yes'???


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT