EasyCFM.COM ColdFusion Forums / Coding Help! / Message of the #currentRow-1#

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Message of the #currentRow-1#

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

joon
02-01-2004 @ 3:59 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 272
Joined: Aug 2003

<cfoutput query="list>
(#currentRow#) #message#
</cfoutput>

(1) 10394AAA45
(2) 947484983
(3) 5410099583
(4) 20AAA394485
(5) 989384347

I have the above output code and its result.

Please notice (1) and (4) contain AAA among their values.
I like to ADD "YES" in the records which are followed by the records which contain AAA among their values.

What I want to get  would be the following.

(1) 10394AAA45
(2) YES 947484983
(3) 5410099583
(4) 20AAA394485
(5) YES 989384347

(2) has YES because the message of the #currentRow-1#  contains "AAA". - (1) contains AAA.
(5 has YES because the message of the #currentRow-1#  contains "AAA". - (4) contains AAA.


The following is one of my trials.


<cfoutput query="list>

<cfif #currentRow-1.message# contains "AAA">
(#currentRow#) YES #message#
<cfelse>
(#currentRow#)  #message#
</cfif>

</cfoutput>

Would you  please make  my above trial to work?

CJ
02-01-2004 @ 10:00 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4262
Joined: Oct 2002

<cfoutput query="list">
     <cfif currentrow GT 1>
          <cfif list['message'][currentrow-1] CONTAINS "AAA">
               (#currentrow#) YES #message#
          <cfelse>
               (#currentrow#) #message#
          </cfif>
     </cfif>
</cfoutput>


          

-CJ-
@ #coldfusion/DALNet
http://charlie.griefer.com


Website Designed and Developed by Pablo Varando.