Questions tagged [cfloop]

CFLoop: ColdFusion Loop This is a conditional loop. A conditional loop iterates over a set of instructions as long as a condition is True. To use this type of loop correctly, the instructions must change the condition every time the loop iterates, until the condition is False. Conditional loops are known as WHILE loops, as in, "loop WHILE this condition is true."

<cfloop> is a ColdFusion tag that is used to iterate over data. It supports five different types of loops:

  1. Index Loops
  2. Condition Loops
  3. Looping over a Query
  4. Looping over a List
  5. Looping over a Structure

Read more about the different kinds of loops here

145 questions
2
votes
1 answer

how to append array value from < cfloop> in coldfusion?

I am a beginner in ColdFusion and want to append values to an array from within a loop. I have written this code, but it does not work for me.
vinny
  • 128
  • 1
  • 12
2
votes
1 answer

ColdFusion processing a form more efficiently and a minor error

I have a form processing that I am sure can be done more efficiently and there is an error in the result set although not "life threatening" just not correct. The purpose of the page is to associate an item with a program and at the same time…
pacific
  • 23
  • 4
2
votes
1 answer

Cfloop in sql statement?

I was wondering if it's possible to loop inside sql statement. In my case I had two years that I created for testing purpose. Now I would like to create years dynamically because I can have more than two records. Here is my code that I used for…
espresso_coffee
  • 5,980
  • 11
  • 83
  • 193
2
votes
1 answer

Coldfusion create array from dynamic form checkboxes

I have a dynamic form with multiple checkboxes and on submit I want to run a CFSTOREDPROC in another cfloop using only the checkbox values that changed status. So far below is a rough concept that I am trying to test but I am sure the way I am…
Denoteone
  • 4,043
  • 21
  • 96
  • 150
2
votes
1 answer

Using cfthread inside cfloop results in random output

I have a routine in ColdFusion that loops over a list of application IDs. Inside that list, many things happen, including the generation and merging of PDF docs. This gets very slow so I took a look at what cfthread can do for me. The results are…
user5639765
2
votes
1 answer

Getting strange characters when using cffile to loop over a csv

I' am on ColdFusion 11. I' am using the following code to loop over a CSV File and output the first row in the loop.
Devil Raily
  • 562
  • 1
  • 5
  • 15
2
votes
0 answers

My first memory leak? ColdFusion

A while back I posted an issue relating to an issue I was having relating to CFThread exceeding GC Overhead limit (Note: someone marked a response as the answer but the issue has never been resolved). After months and months of reading and taking…
CPB07
  • 679
  • 3
  • 13
  • 23
2
votes
1 answer

cfloop through dynamic form fields

I have a form that allows the user to add co-authors so I'm trying to loop through those fields (if they exist) but can't seem to be able to get the values. "coauthorNo" is a hidden input field that only exists if the user adds 1 or more co-authors.…
TheRanch
  • 23
  • 7
2
votes
2 answers

Looping over a Cfquery or a Struct?

I have a query which retrieves Some data. I want to display that data considering some conditions in different div tags. Now my question is, I am doing this by looping the query once and getting the data in three different structs and using these…
Somu
  • 131
  • 7
2
votes
1 answer

cfloop an array and read content line by line

I'm just wondering if there is a way, in ColdFusion, to loop over an array of text and then loop over the text line by line ? The cfloop above loops through a file. However,…
user125264
  • 1,809
  • 2
  • 27
  • 54
2
votes
5 answers

cfloop over array/list does not permit reference to previous values

I frequently use cfloop over an array or list because I have complex computations involving the values of the array. However, there doesn't seem to be a way to refer back to a specific member of the array/list. If I use an ordinary loop I can…
Betty Mock
  • 1,373
  • 11
  • 23
2
votes
3 answers

Creating dynamically named variables

I'm fairly new, as you'll see. I want to create the following variables: V1 = word 1 in my query V2 = word 2 in my query etc... I can do this statically like so:
2
votes
5 answers

Sum values in cfloop

I am referring to a previous SO Coldfusion Calculate Sum Total (Loop? ) that was marked as a correct answer, but the code doesn't work for me. I am trying to create a grand total from several fields. But the error I receive is that "Variable xxx is…
Jay Rizzi
  • 4,196
  • 5
  • 42
  • 71
2
votes
1 answer

ColdFusion - Using a cfloop with multiple fields and multiple submit buttons

I'm looking to pass form values in a cfform to a PDF using cfpdfform. Here's my little test page that loops through 50 records to pull the first and last name. I'm trying to just pull those into the pdf fields. Currently it puts in all 50 of the…
Macness
  • 1,226
  • 2
  • 13
  • 24
2
votes
1 answer

CFLOOP with doubles - Coldfusion

I am trying to use cfloop to loop form 0.0 to 5.0 but it takes out the decimal point and is looping from 0 to 5 instead. This is my code