unit Employee;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TEmployee = class (TComponent)
private
FName: string[ 10 ];
FAge: Integer;
FSalary: Integer;
protected
{..................................}
public
constructor Create(Owner: TComponent); override;
destructor Destroy; override;
function GetName: string;
function GetSalary: Integer;
function GetAge: Integer;
procedure SetName(sName: string);
procedure SetAge(iAge: Integer);
procedure SetSalary(iSalary: Integer);
published
property Name: string read GetName write SetName;
property Age: Integer read GetAge write SetAge;
property Salary: Integer read GetSalary write SetSalary;
end;
procedure register;
implementation
procedure register;
begin
RegisterComponents( ' Samples ' ,[TEmployee]);
end;
{ TEmployee }
constructor TEmployee.Create(Owner: TComponent);
begin
inherited Create(nil);
Name : = '' ;
FAge : = 0;
FSalary : = 0;
end;
destructor TEmployee.Destroy;
begin
inherited;
end;
function TEmployee.GetAge: Integer;
begin
GetAge : = FAge;
end;
function TEmployee.GetName: string;
begin
GetName : = FName;
end;
function TEmployee.GetSalary: Integer;
begin
GetSalary : = FSalary;
end;
procedure TEmployee.SetAge(iAge: Integer);
begin
FAge : = iAge;
end;
procedure TEmployee.SetName(sName: string);
begin
FName : = sName;
end;
procedure TEmployee.SetSalary(iSalary: Integer);
begin
FSalary : = iSalary;
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TEmployee = class (TComponent)
private
FName: string[ 10 ];
FAge: Integer;
FSalary: Integer;
protected
{..................................}
public
constructor Create(Owner: TComponent); override;
destructor Destroy; override;
function GetName: string;
function GetSalary: Integer;
function GetAge: Integer;
procedure SetName(sName: string);
procedure SetAge(iAge: Integer);
procedure SetSalary(iSalary: Integer);
published
property Name: string read GetName write SetName;
property Age: Integer read GetAge write SetAge;
property Salary: Integer read GetSalary write SetSalary;
end;
procedure register;
implementation
procedure register;
begin
RegisterComponents( ' Samples ' ,[TEmployee]);
end;
{ TEmployee }
constructor TEmployee.Create(Owner: TComponent);
begin
inherited Create(nil);
Name : = '' ;
FAge : = 0;
FSalary : = 0;
end;
destructor TEmployee.Destroy;
begin
inherited;
end;
function TEmployee.GetAge: Integer;
begin
GetAge : = FAge;
end;
function TEmployee.GetName: string;
begin
GetName : = FName;
end;
function TEmployee.GetSalary: Integer;
begin
GetSalary : = FSalary;
end;
procedure TEmployee.SetAge(iAge: Integer);
begin
FAge : = iAge;
end;
procedure TEmployee.SetName(sName: string);
begin
FName : = sName;
end;
procedure TEmployee.SetSalary(iSalary: Integer);
begin
FSalary : = iSalary;
end;
end.