Solved

Append to file or Var

Posted on 2002-04-19
2
273 Views
Last Modified: 2013-11-18
Hello everyone!

I have a file called  ABC.Dat
I want to Append text to it ?

I have a Var called (123)
I want to Append to it ?

Thanks in Advance
DB
0
Comment
Question by:Dinkleburger
2 Comments
 
LVL 2

Accepted Solution

by:
freshman3k earned 25 total points
ID: 6955226
Hello!

Here's how you do it(A function I created):

procedure AppendString(FileName: String; AStr: String);
var
    Stream: TFileStream;
begin
    Stream := TFileStream.Create(FileName, fmOpenWrite);
    Stream.Seek(0,soFromEnd);
    Stream.Write(PChar(AStr),Length(AStr));
    Stream.Free;
end;

Example how to use it:
AppendString('c:\ABC.Dat','123');

Good Luck! :)
0
 

Author Comment

by:Dinkleburger
ID: 6956281
Thank you for that
thats what i need...
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

810 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