file-problem
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?
Try using Memo1.Text instead of Memo1.Lines. Lines returns a TStrings-based object, not a string.
Steve ''Sly'' Williams Monkey Wrangler Krome Studios
Steve ''Sly'' Williams Monkey Wrangler Krome Studios
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:
Edited by - TheSisko on October 19, 2001 1:57:43 AM
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
Hi there,
you could also just call
Memo1.Lines.SaveToFile(FileName);
but i suspect you knew that
Mark.
you could also just call
Memo1.Lines.SaveToFile(FileName);
but i suspect you knew that
Mark.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement