uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TRecord=packed record
name:string[20];
information:array[0..1023] of char;
end;
RF= file of TRecord;
type
TForm1 = class(TForm)
Memo1: TMemo;
Button1: TButton;
Memo2: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
records:TRecord;
RFS:RF;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
AssignFile(RFS, 'c:\a.txt');
if FileExists('c:\a.txt') then
Reset(RFS)
else
Rewrite(RFS);
records.name :='asdfasdf';
for i:=0 to 1023 do
records.information[i] :=Pchar(copy(Memo1.Text,i,1))^;