You don't need a custom tag to do this.  You need to use the Append action
of the cffile tag.

--K

-----Original Message-----
From: Neil Clark [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 23, 2000 7:17 AM
To: CF-Talk
Subject: RE: write var into txt file and save


This is a multi-part message in MIME format.

------=_NextPart_000_0005_01C03D04.54B3B1C0
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

you can do this by using the this Custom Tag - 

<cf_FileWriteText FILE="myFileName.txt">
                <cffile action="READ" file="myFileName.txt"
variable="TempX"> 
</cf_FileWriteText>

hope this helps.

Neil

<! -----------------------------------
Neil Clark
Senior Web Applications Engineer
mcb digital
Tel. +44 (0)20 8941 3232
Tel. +44 (0)20 8408 8131 [Direct]
http://www.mcbdigital.com
----------------------------------->



------=_NextPart_000_0005_01C03D04.54B3B1C0
Content-Type: application/octet-stream;
        name="CF_FileWriteText.cfm"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
        filename="CF_FileWriteText.cfm"

<CFSETTING ENABLECFOUTPUTONLY=3D"YES"><!--- Suspend whitespace output =
--->


<!--- Include tag name in all error messages --->
<CFSET ErrorHeader =3D"<P><B>Error Occurred in CF_FileWriteText =
Tag.</B></P>">

<!--- Tag parameters --->
<CFIF NOT IsDefined("Attributes.File")>
  <CFABORT SHOWERROR=3D"#ErrorHeader# The FILE attribute is required.">
</CFIF>
<CFPARAM NAME=3D"Attributes.Action" DEFAULT=3D"Write">


<!--- Make sure a closing tag exists in calling template --->
<CFIF NOT ThisTag.HasEndTag>
  <CFABORT SHOWERROR=3D"#ErrorHeader# You need to supply a closing =
&lt;CF_FileWriteText&gt; tag.">
</CFIF> =20


<!--- When the closing tag is encountered... --->
<CFIF ThisTag.ExecutionMode is "End">

  <!--- Do different things based on ACTION parameter --->
  <CFSWITCH EXPRESSION=3D"#Attributes.Action#">
    <CFCASE VALUE=3D"Write">
      <CFFILE
        FILE=3D"#Attributes.File#"
        ACTION=3D"WRITE"
        OUTPUT=3D"#ThisTag.GeneratedContent#">
    </CFCASE>

    <!--- If ACTION=3D"APPPEND" --->
    <CFCASE VALUE=3D"Append">
      <CFFILE
        FILE=3D"#Attributes.File#"
        ACTION=3D"APPEND"
        OUTPUT=3D"#ThisTag.GeneratedContent#">
    </CFCASE>
   =20
    <!--- Must have been an invalid ACTION parameter --->
    <CFDEFAULTCASE>
      <CFABORT SHOWERROR=3D"#ErrorHeader# You supplied an invalid ACTION =
parameter.  Only WRITE and APPEND are allowed.">
    </CFDEFAULTCASE>
  </CFSWITCH>
 =20
  <!--- Set the tag's GeneratedContent value to empty string --->
  <!--- so output doesn't get shown on web page --->
  <CFSET ThisTag.GeneratedContent =3D "">
</CFIF>


<CFSETTING ENABLECFOUTPUTONLY=3D"NO"><!--- Re-enable whitespace output =
--->
------=_NextPart_000_0005_01C03D04.54B3B1C0--

----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to