home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1999 March
/
Chip_1999-03_cd.bin
/
zkuste
/
delphi
/
D
/
NICER.ZIP
/
UTAnoKid.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-02-05
|
2KB
|
106 lines
{UTAnoKid.pas}
{$X+ extended syntax}
unit Utanokid;
INTERFACE
uses
Classes,
UTAnothe;
type
TAnotherKid = class( TAnother )
constructor Create(const aString: string; const aDouble: double);
constructor Clone(const aTAnotherKid: TAnotherKid);
constructor Get(S: TStream);
constructor Read(var f: Textfile);
destructor Destroy; override;
procedure Copy(const aTAnotherKid: TAnotherKid);
function Equals(const aTAnotherKid: TAnotherKid): boolean;
procedure Put(S: TStream);
procedure Write(var f: Textfile);
function GetD: double;
function SetD(const aDouble: double): double;
private
d: double;
end; {TAnotherKid}
{]====================================================[}
IMPLEMENTATION
uses
SysUtils;
constructor TAnotherKid.Create(const aString: string; const aDouble: double);
begin
inherited Create(aString);
d := aDouble;
end; {Create}
constructor TAnotherKid.Clone(const aTAnotherKid: TAnotherKid);
begin
inherited Clone(aTAnotherKid);
d := aTAnotherKid.d;
end; {Clone}
constructor TAnotherKid.Get(S: TStream);
begin
inherited Get(S);
S.Read(d,sizeof(d));
end; {Get}
constructor TAnotherKid.Read(var f: Textfile);
begin
// to be added
end; {Read}
destructor TAnotherKid.Destroy; {override}
begin
inherited Destroy;
end; {Destroy}
procedure TAnotherKid.Copy(const aTAnotherKid: TAnotherKid);
begin
if Self = aTAnotherKid then Exit; {don't clobber self}
inherited Copy(aTAnotherKid);
d := aTAnotherKid.d;
end; {Copy}
function TAnotherKid.Equals(const aTAnotherKid: TAnotherKid): boolean;
begin
Result := true;
if Self = aTAnotherKid then Exit; {saves time?}
Result := Result and TAnother(Self).Equals(TAnother(aTAnotherKid));
Result := Result and (d = aTAnotherKid.d);
end; {Equals}
procedure TAnotherKid.Put(S: TStream);
begin
inherited Put(S);
S.Write(d,sizeof(d));
end; {Put}
procedure TAnotherKid.Write(var f: Textfile);
begin
end; {Write}
function TAnotherKid.GetD: double;
begin
Result := d;
end; {GetD}
function TAnotherKid.SetD(const aDouble: double): double;
begin
Result := d;
d := aDouble;
end; {SetD}
{initialization}
{finalization}
end. {UTAnoKid.pas}