Solved

Increment a variable?

Posted on 2004-09-17
5
181 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

738 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