虽然菜,你试试看...在线等。。。
ma369 2003-06-11 11:52:10 最近写一个数据处理的程序,可是在定义变量和读数据是总是出错。程序如下:
type
TDataFile= packed record
...
ParNum:word;
...
end;
a:TDataFile;
type
data = record
Parvalue:=array of single;
V:=array of integer;
end;
dd:data;
DataIn:file;
...
begin
...
SetLength(ParValue,a.ParNum);
...
BlockRead(datain,ParValue,sizeof(dd) ,NumRead);
...
GridString.cell[x,y]:=format('8.3%f',dd.ParValue[k]);
...
end;
但是我把定义的数组设成固定值,一切就解决了。如下:
...
type
data = record
Parvalue:=array[0..200] of single;
V:=array[0..12] of integer;
end;
dd:data;
...
可是我需要的是变化的,为什末总是出错哪,帮帮我,绝对送分。。。