to 蓝叶菱,谢谢你的回答,我是希望在函数中改变record的值,例如
implementation
{$R *.dfm}
type
TEnemy= record
f: Integer
{ Frame No }
c: string
{ Class }
x: Integer
{ X }
y: Integer
{ Y }
end;
procedure TForm1.FormCreate(Sender: TObject);
var
Enemy:TEnemy;
begin
Enemy:=(f:1;c:'xxxx';x:1;y:1);
end;
提示:
[Error] Unit1.pas(37): Undeclared identifier: 'f'
如果在函数var里申明f,c,x,y等变量,则提示:
[Error] Unit1.pas(41): ')' expected but ':' found
creation-zy的没话说了,连borland都这样写。不过钻一下牛角尖,到底能不能写在一行上?不行也罢, 得到正确答案就结帖^^