Solved

Increment a variable?

Posted on 2004-09-17
5
178 Views
Last Modified: 2013-12-24
I have a table thats 52 columns wide, I have 52 fields (w1-w52) that I need to display for each person, i need to do something like:


<tr>
<cfset k1 = 0>
<cfoutput query="grp1" >
   <cfset k1 = k1 + 1>
   <td><font size="-1">#grp1.w##k1#</font></td>
</cfoutput>
<tr>

Is that possible, I keep getting a "element W is undefined" error.

john
0
Comment
Question by:jcorbin
  • 2
5 Comments
 
LVL 15

Accepted Solution

by:
danrosenthal earned 100 total points
ID: 12089595
Try this...

<tr>
<cfset k1 = 0>
<cfoutput query="grp1" >
   <cfset k1 = k1 + 1>
   <td><font size="-1">#evaluate('grp1.w'&k1)#</font></td>
</cfoutput>
<tr>
0
 

Author Comment

by:jcorbin
ID: 12089656
dood thats exactly what I wanted! thanks!
0
 
LVL 15

Expert Comment

by:danrosenthal
ID: 12089668
no problem
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question