Solved

Increment a variable?

Posted on 2004-09-17
5
176 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
Comment Utility
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
Comment Utility
dood thats exactly what I wanted! thanks!
0
 
LVL 15

Expert Comment

by:danrosenthal
Comment Utility
no problem
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

12 Experts available now in Live!

Get 1:1 Help Now