// 写入文本文件的函数 Text:字符串 FileName1:文件名
procedure TFrm1.WriteTextFileContents(text:string;fileName1:string);
var
myfile:textFile;
begin
AssignFile(myFile,fileName1);
rewrite(myFile);   //覆盖或创建新的try
  writeln(myfile,text);
finally
closeFile(myFile);
end; //try
end;//调用
  str:='1'+#13+'100'
  showMessage(str);   //可以显示出是换行了
  frm1.WriteTextFileContents(str,'m.txt');  // m.txt文件中显示的是方块// 从m.txt中读取
function  TFrm1.ReadTextFileContents(filename1:string):string;
 var
myfile:textFile;
s:string;
begin
AssignFile(myFile,fileName1);
if FileExists(fileName1) then          
  reset(myFile)
else
raise Exception.Create(fileName1+'文件不存在');try
  while not eof(myFile) do
  begin
  readln(myfile,s);
  result:=result+s;
  end; //while
finally
closeFile(myFile);
end; //try
showMessage(result);   // 是连在一起的
end;
// 为什么向m.txt中写入的时候含有#13也就是说有回车了
可是读取的时候不能读出来换行了我是想要的结果是是:
比如你写入文件文件是 'first'+#13+'second'   //要一次性写入,而不用写一行first再写second
那么我读出来的也是  'first'+#13+'second' ,而不是连在一起的是不是Writeln,或Readln有错啊?
谢谢