TextFile read and write

xiaoxiao2021-03-06  58

Function ReadFromFile: string; var s, s2: string; f: textfile; begin openiteog1.filename: = '; OpenDialog1.filter: =' *. xml | * .xml '; s: ='; result: = ' '; If not opendialog1.execute kiln

AssignFile (f, OpenDialog1.FileName); try reset (f); while not EOF (f) do begin readln (f, s2); s: = s s2; end; result: = s; finally closefile (f); END;

Procedure WriteTofile (s: string); var f: TextFile; Begin AssignFile (f, savedialog1.filename); tryaling (f); WriteLn (f, s1); finally closefile (f); end; end;

转载请注明原文地址:https://www.9cbs.com/read-109139.html

New Post(0)