Показать сообщение отдельно
  #14  
Старый 08.08.2011, 18:03
bezzzare bezzzare вне форума
Прохожий
 
Регистрация: 05.08.2011
Сообщения: 27
Репутация: 10
По умолчанию

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
test = class
private
a: integer;
public
function x(y: integer): integer;
end;
var
Form1: TForm1;

implementation

constructor test.create;
begin
a:=0;
end;

function test.x(y: integer):integer;
begin
x:=a+y;
end;

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
label1.Caption := inttostr(function test.x(5));
end;

end.
Ответить с цитированием