导航:
论坛 -> DELPHI技术
斑竹:liumazi,sephil
作者:
pch (走刀口)
★☆☆☆☆
-
盒子活跃会员
2004/1/19 17:56:54
标题:
谁能告诉我这是为什么啊?回帖发钱!
浏览:1652
加入我的收藏
楼主:
unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, Menus; 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; TForm1 = class(TForm) MainMenu1: TMainMenu; N1: TMenuItem; N2: TMenuItem; N3: TMenuItem; N4: TMenuItem; procedure N3Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.N3Click(Sender: TObject); var mapfile :file of mapdata; begin end; end. 为什么每次运行到 var mapfile :file of mapdata; 就回出现 type 'mapdata' needs finalization - not allowed in file type 错误 谁能告诉我啊 啊啊啊啊啊啊啊啊啊啊啊
----------------------------------------------
漏洞,漏洞,我的爱!
作者:
pch (走刀口)
★☆☆☆☆
-
盒子活跃会员
2004/1/19 17:59:37
1楼:
¥ ¥ ¥¥¥ ¥ ¥ ¥ ¥
----------------------------------------------
漏洞,漏洞,我的爱!
作者:
2004/1/19 17:59:48
1楼:
文件类型的变量不允许定义成局部变量,你可以将 var mapfile :file of mapdata; 放在implementation下: implementation var mapfile :file of mapdata; 或定义成类域。
----------------------------------------------
www.acreport.com
作者:
pch (走刀口)
★☆☆☆☆
-
盒子活跃会员
2004/1/19 18:00:57
2楼:
哈哈哈哈哈哈 谢谢 谢谢 谢谢 这个问题一直困饶着我
----------------------------------------------
漏洞,漏洞,我的爱!
作者:
pch (走刀口)
★☆☆☆☆
-
盒子活跃会员
2004/1/19 18:04:47
3楼:
不行不行 还是会出错啊
----------------------------------------------
漏洞,漏洞,我的爱!
作者:
2004/1/19 23:39:40
4楼:
procedure TForm1.N3Click(Sender: TObject); implementation uses // hidden global variable var mapfile :file of mapdata; // all the exported functions must be coded procedure MyProc; begin // ... code of procedure TForm1.N3Click(Sender: TObject); end; initialization // optional initialization part finalization // optional clean-up code
----------------------------------------------
-