unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
abc=record
a:integer;
b:integer;
c:integer;
end;
const
aaa:abc=(a:1;b:2;c:3);
function ddd(const aaa:abc):integer;
type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function ddd(const aaa:abc):integer;
begin
result:=aaa.a+aaa.b+aaa.c;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
aaa.a:=23
aaa.b:=34
aaa.c:=45;
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^上面这一行报错误,
edit1.Text:=inttostr(ddd(aaa));
end;
我将如何修改函数function ddd(const aaa:abc):integer;的输入值啊?
end.