J
jsxjd
Unregistered / Unconfirmed
GUEST, unregistred user!
结果如下:
2.37 1.48 0.64
1278.02 3008.73 404.69
639.56 906.41 1314.06
1350.16 3109.20 413.25
你应该看到,我的方法是直观的,在这里主要是定义一个结构。
implementation
{$R *.DFM}
type
TInt=packed record
wacked array[0..2] of word;
dwacked array[0..8] of Dword;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
xInt:TInt;
fint:file of Tint;
i:integer;
a:array[0..10] of Real;
begin
AssignFile(fint,'d:/t0105.101');
Reset(fint);
Read(fint,xint);
closefile(fint);
memo1.Clear;
for i:=0 to 2 do a:=(xint.w / 100);
memo1.lines.add(Format('%f %f %f',[a[0],a[1],a[2]]));
for i:=0 to 8 do a:=(xint.dw / 100000);
memo1.lines.add(Format('%f %f %f',[a[0],a[1],a[2]]));
memo1.lines.add(Format('%f %f %f',[a[3],a[4],a[5]]));
memo1.lines.add(Format('%f %f %f',[a[6],a[7],a[8]]));
end;
2.37 1.48 0.64
1278.02 3008.73 404.69
639.56 906.41 1314.06
1350.16 3109.20 413.25
你应该看到,我的方法是直观的,在这里主要是定义一个结构。
implementation
{$R *.DFM}
type
TInt=packed record
wacked array[0..2] of word;
dwacked array[0..8] of Dword;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
xInt:TInt;
fint:file of Tint;
i:integer;
a:array[0..10] of Real;
begin
AssignFile(fint,'d:/t0105.101');
Reset(fint);
Read(fint,xint);
closefile(fint);
memo1.Clear;
for i:=0 to 2 do a:=(xint.w / 100);
memo1.lines.add(Format('%f %f %f',[a[0],a[1],a[2]]));
for i:=0 to 8 do a:=(xint.dw / 100000);
memo1.lines.add(Format('%f %f %f',[a[0],a[1],a[2]]));
memo1.lines.add(Format('%f %f %f',[a[3],a[4],a[5]]));
memo1.lines.add(Format('%f %f %f',[a[6],a[7],a[8]]));
end;