type mapdata=record mapindex:array[1..7500] of integer; maparouse:array[1..7500] of string; unitwidth,unitheight:array [1..7500] of integer; mapxindex,mapyindex:integer; spwidth,spheight:integer; end;
记录类型的文件要求一个固定长度(size)的类型,显然你定义的mapdata的size是不固定的,所以无法编译,原因是因为string的长度没有固定,你可以把改成: maparouse:array[1..7500] of string[N]; 其中N是最大长度。
如: type mapdata=record mapindex:array[1..7500] of integer; maparouse:array[1..7500] of string[1000]; unitwidth,unitheight:array [1..7500] of integer; mapxindex,mapyindex:integer; spwidth,spheight:integer; end;