This is much more efficient, Bud.  However, it depends on how long the
cumulative records are.

I haven't tested this on 4.5+, but under 4.01, if I tried to write a
variable to disk that was over about 32k, the CF server would spike at 100%
CPU and lock up completely, requiring a reboot.

Just a heads up!

Jeff


-----Original Message-----
From: Bud [mailto:[EMAIL PROTECTED]]
Sent: Sunday, September 10, 2000 6:22 AM
To: [EMAIL PROTECTED]
Subject: RE: cffile and cfloop ?


On 9/9/00, Jeff Beer penned:
>How about:
>
><cfif NOT FileExists('D:/xy/text.txt')>
>
><cffile action="write"
>         file="D:/xy/text.txt"
>         output=""
>         addnewline="no">
></cfif>
>
><cfoutput query="collectData">
><cffile action="append"
>         file="D:/xy/text.txt"
>         output="#begriff#"
>         addnewline="Yes">
></cfoutput>

Or this, where you'll only have to perform a single write:

<cfset mydata = "">
<cfoutput query="collectData">
<cfif currentrow LT recordcount>
<cfset mydata = mydata & begriff & chr(10)>
<cfelse>
<cfset mydata = mydata & begriff>
</cfif>
</cfoutput>

<cffile action="write"
file="D:/xy/text.txt"
output="#mydata#"
  addnewline="No">
--

Bud Schneehagen - Tropical Web Creations

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
954.721.3452
----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to