Solved

Append to file or Var

Posted on 2002-04-19
2
278 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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

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…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

726 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