codetools: examples for advanced records

git-svn-id: trunk@29361 -
This commit is contained in:
mattias 2011-02-03 21:54:04 +00:00
parent 38725ab0ee
commit 1687922e06

View File

@ -14,7 +14,7 @@ type
F1: Integer; F1: Integer;
F2: Byte; F2: Byte;
public public
{ type type
TBar = Integer; TBar = Integer;
const const
C: TBar = 1; C: TBar = 1;
@ -29,7 +29,7 @@ type
var var
F: Int; F: Int;
const const
DefaultF: Int = 1;} DefaultF: Int = 1;
public public
function GetF: integer; function GetF: integer;
procedure SetF(const Value: integer); procedure SetF(const Value: integer);
@ -70,17 +70,17 @@ type
function TRec1.GetF: integer; function TRec1.GetF: integer;
begin begin
Result := F1; Result := F;
end; end;
procedure TRec1.SetF(const Value: integer); procedure TRec1.SetF(const Value: integer);
begin begin
F1 := Value; F := Value;
end; end;
class operator TRec1.Inc(Rec: TRec1): TRec1; class operator TRec1.Inc(Rec: TRec1): TRec1;
begin begin
Result.F1 := Rec.F1 + 1; Result.F := Rec.F + 1;
end; end;
begin begin