Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
fpc-src / usr / share / fpcsrc / 3.2.0 / tests / webtbs / tw21044.pp
Size: Mime:
{ %norun}
program tw21044;

{$mode Delphi}

uses
  SysUtils, Classes;

type
  { TTestRecord }

  TTestRecord = record
  public
    function Test(const Lhs, Rhs: TTestRecord): TTestRecord;
    // operator overloads
    class operator Add(const Lhs, Rhs: TTestRecord): TTestRecord;
    // this part changes the size of record and so the way of parameter handling
    // on some 64bit systems
  case Boolean of
    False: (Value: Single);
    True: (AsInteger: Integer);
  end;

{ TTestRecord }

function TTestRecord.Test(const Lhs, Rhs: TTestRecord): TTestRecord;
begin
  Result.AsInteger := Lhs.AsInteger + Rhs.AsInteger;
end;

class operator TTestRecord.Add(const Lhs, Rhs: TTestRecord): TTestRecord;
begin
  Result.Value := Lhs.Value + Rhs.Value;
end;

begin
end.