如何将所有结果保存到导航中的txt文件中?

时间:2019-10-07 13:46:32

标签: nav erp navision

我有一个分类帐条目表,我正在遍历它查找差距,然后将它们保存在file.txt中,但它仅适用于最后一个间隙,如何将所有结果保存在我的文件中?

IF LibraryLedgerEntry.FINDLAST THEN
  LastEntryNo := LibraryLedgerEntry."Entry No.";
  IF LastEntryNo <> 0 THEN BEGIN
    FOR i := 1 TO LastEntryNo DO BEGIN
      LibraryLedgerEntry.RESET;
      LibraryLedgerEntry.SETRANGE("Entry No.",i);
    IF NOT LibraryLedgerEntry.FINDFIRST THEN BEGIN
      REPEAT                    
        MyFile.CREATE('C:\MyNewFolder\MyWriteText.txt');
        MyFile.CREATEOUTSTREAM(OutStreamObj);            
        OutStreamObj.WRITETEXT(FORMAT(i));
        OutStreamObj.WRITETEXT();
      UNTIL LibraryLedgerEntry.NEXT = 0 ;
      MyFile.CLOSE;
    END;
  END;
END;

0 个答案:

没有答案