Archived

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

TheSisko

file-problem

Recommended Posts

TheSisko    122
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
TheSisko    122
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