Код считывающей программы (юнит полностью)
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
F: File;
BufSize,Bf: Int64;
Script, S2: TStringList;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
//Script := TStringList.Create;
//S2 := TStringList.Create;
AssignFile(F,(ParamStr(0)));
FileMode := 0;
Reset(F);
Seek(F,FileSize(F)-SizeOf(Int64));
BlockRead(F,BufSize,SizeOf(Int64));
Seek(F,FileSize(F)-(BufSize + SizeOf(Int64)));
BlockRead(F,S2,BufSize);
ShowMessage('Script Line 0: ' + S2.Strings[0]);
CloseFile(F);
end;
end.
Среда: Delphi 2009
Проблема возникает на этой строке:
ShowMessage('Script Line 0: ' + S2.Strings[0]);
Нужно много строк записать, по ссылке было для дописывания одной строки.