2 Replies Latest reply on Nov 18, 2010 1:56 PM by Kkofal

    Looping over CFFILE only writes last line

    Kkofal Level 1

      Here is the code in question:

       

      <CFSET LINECOUNT = 0>

       

      <cfloop list="#populate#" index="CL">

            <CFOUTPUT>#CL#:<input type="text" name="#CL#"><BR></CFOUTPUT>
            <CFSET LINECOUNT = LINECOUNT + 1>
            <CFSET ThisNewLine = '<input type="text" name="#CL#">#CL#'>
            <cffile action="append" file="#Application.BaseRef#Temp\#URL.Field#.CFM" output="#ThisNewLine#" addnewline="Yes">
      </cfloop>

       

      Linecount = <CFOUTPUT>#LineCount#</CFOUTPUT>

       

      The list populate# has 28 items in it, the output to the screen is 28 lines of input boxes, the line count variable value is 28 but only one line (The last line) is written to the file.

      What is the world am I overlooking?

       

      Thanks,

       

      Kev