1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls, ExtCtrls, TeeProcs, TeEngine, Chart;
type
TForm1 = class(TForm)
...
private
{ Déclarations privées }
public
{ Déclarations publiques }
end;
type
Trpoint = class
private
X_:Real;
procedure SetX(Valeur: real);
public
constructor Create;
destructor Destroy;
property X:real read X_ write SetX;
end;
var
Form1: TForm1;
pp:Trpoint;
implementation
{$R *.dfm}
constructor Trpoint.Create;
begin
X_:=0;
end;
destructor Trpoint.Destroy;
begin
end;
procedure Trpoint.SetX(Valeur: real);
begin
X_ := Valeur;
end;
procedure TForm1.Button3Click(Sender: TObject);
var r:real;
i:integer;
begin
r:= pp.X;
i:=round(r);
Button3.Caption:=inttostr(i);
end;
end. |
Partager