Solved

Increment a variable?

Posted on 2004-09-17
5
177 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
website file permissions 4 65
nginx with multiple websites --need help with phpmyadmin please 5 54
Problem to Eclipse 16 116
spamming  on Hosted svrs? 6 72
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now