• Advertisement

Archived

This topic is now archived and is closed to further replies.

file-problem

This topic is 5939 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m quite new to working with files, and I have a problem. This is the body of my function (what is of importance to you): AssignFile(Text,SaveDialog1.FileName); Rewrite(Text); Write(Text, memo1.lines); CloseFile(text); I declared ''text'' as : var Text:Textfile; Any help?

Share this post


Link to post
Share on other sites
Advertisement
Well, I have it solved now, but I don't really remember what I actually did.....
That's the way it usually goes with me: type something, compile, not working. Add some begins and ends, some: , and try again heheh

the code now looks like this:

procedure TForm1.SaveText;
var
Text:textfile;
begin
if SaveDialog1.Execute then
begin
AssignFile(Text,SaveDialog1.FileName);
Rewrite(Text);
Write(Text, memo1.text);
CloseFile(text);
end;
end;


Edited by - TheSisko on October 19, 2001 1:57:43 AM

Share this post


Link to post
Share on other sites
Hi there,

you could also just call

Memo1.Lines.SaveToFile(FileName);

but i suspect you knew that

Mark.

Share this post


Link to post
Share on other sites

  • Advertisement