Jonas Maebe 21 years ago
parent
commit
beedbae08a
1 changed files with 47 additions and 0 deletions
  1. 47 0
      tests/webtbs/tw3214.pp

+ 47 - 0
tests/webtbs/tw3214.pp

@@ -0,0 +1,47 @@
+{$mode objfpc}{$H+}{$r+}
+
+uses
+  Classes, SysUtils; 
+
+type
+  TMyEvent = class(TObject)
+  public
+    procedure SaveToStream(aStream: TStream); virtual; abstract;
+  end;
+
+  TMyClass = class
+  private
+    function GetEvent(aIndex: integer): TMyEvent;
+    function GetEventCount: integer;
+  public
+    property EventCount: integer read GetEventCount;
+    property Events[aIndex: integer]: TMyEvent read GetEvent;
+    procedure SaveToStream(aDest: TStream);
+  end;
+
+{ TMyClass }
+
+function TMyClass.GetEvent(aIndex: integer): TMyEvent;
+begin
+  Result:=nil;
+end;
+
+function TMyClass.GetEventCount: integer;
+begin
+  Result:=0;
+end;
+
+procedure TMyClass.SaveToStream(aDest: TStream);
+var
+  cEvent: Integer;
+  eCnt: Integer;
+begin
+  eCnt:=EventCount;
+  aDest.Write(eCnt, sizeof(eCnt));
+  for cEvent := 0 to eCnt -1 do
+    Events[cEvent].SaveToStream(aDest);
+end;
+
+begin
+end.
+