私はアンドロイドの携帯電話でファイル(test.txt)にテキストを保存しようとしていますが失敗しました。これは私のコード例です。いくつかのテキストを書き、アンドロイドの電話に保存
procedure TDM.WriteLog(text:string);
var
myFile : TextFile;
begin
// Try to open the Test.txt file for writing to
AssignFile(myFile, System.IOUtils.TPath.Combine(System.IOUtils.tpath.getdocumentspath,'test.txt'));
ReWrite(myFile);
// Write a couple of well known words to this file
WriteLn(myFile, text + sLineBreak);
// Close the file
CloseFile(myFile);
end;
私の電話機でファイルを見つけると、ファイルは開いていますが空です。私が忘れたのは?
この場合、[TFile](http://docwiki.embarcadero.com/Libraries/en/System.IOUtils.TFile_Methods)クラスのものを使用します。 – Victoria
@TomBrunberg WriteLog( 'some text')。私が書きたい文字列です。 – Dejan
レガシーIOの使用を中止する時間です –