Peter,


You can use Evaluate....


<cfloop from="1" to="15" index="x">


     #Evaluate('Qty' & x & '_Value')#


</cfloop>


The above would output....th VALUES of the variables:


Qty1_Value
Qty2_Value
Qty3_Value
Qty4_Value
Qty5_Value

HTH,


Mike

-----Original Message-----
From: Peter Filias [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 28, 2004 8:47 AM
To: CF-Talk
Subject: CFIF inside of CFLOOP

I am faced with a puzzle that should be fairly easy to solve.

<cfoutput>
  <cfif Qty1_Value NEQ "">
  <tr bgcolor="cccccc">
  <td align="center">
   #Qty1_Value#
          </td>
          <td>
            #Desc1_Value#</td>
          <td nowrap align=center><CFIF #DropShip1_Value# EQ 1>
Yes<cfelse>&nbsp;</CFIF></td>
          <td><CFIF #FindNoCase('S1',Shipped_Value)# GT 0>
Yes<cfelse>&nbsp;</cfif></td>
  <td><CFIF #ItemDateShipped1_Value# NEQ
''>#ItemDateShipped1_Value#</CFIF></td>
  <td><CFIF #FindNoCase('O1',Ordered_Value)# GT 0>
Yes<cfelse>&nbsp;</cfif></td>
  <td><CFIF #ItemDateOrdered1_Value# NEQ
''>#ItemDateOrdered1_Value#</CFIF></td>
  <td><CFIF #FindNoCase('N1',ItemNew_Value)# GT 0>
Yes<cfelse>&nbsp;</cfif></td>
          <td><CFIF #FindNoCase('F1',ItemFixed_Value)# GT 0>
Yes<cfelse>&nbsp;</cfif></td>
          <td>
            <cfif Price1_Value NEQ
''>#DollarFormat(Price1_Value)#</cfif></td>
        </tr>
  </cfif>
</cfoutout>

I want to repeat that same code a total of 15 times. I tried to use CFLOOP
from=1 to=15 going through my query, but I don't know how to properly call
the index within those CFIF tags.

For example, where it has Price1_Value, I want it to be something like
Price#indexvalue#_Value so that it'll work 1 through 15.

So right now, I have that same code copied 15 times... talk about bloat!

I'd love the help. Thanks.
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to