Solved

Append to file or Var

Posted on 2002-04-19
2
275 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

735 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