tb0618.pp 620 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. type
  2. PStreamRec= ^TStreamRec;
  3. TStreamRec = Packed Record
  4. ObjType : byte;
  5. Next : PStreamRec;
  6. end;
  7. const
  8. BaseRec : PStreamRec= nil;
  9. RType1 : TStreamRec = (
  10. ObjType : 79
  11. );
  12. RType2 : TStreamRec = (
  13. objtype : 80
  14. );
  15. procedure RegisterType(var R : TStreamRec);
  16. var
  17. P : PStreamRec;
  18. begin
  19. P := BaseRec;
  20. while (P <> nil) and (P^.Objtype <> R.ObjType) do
  21. P:=P^.Next;
  22. if not assigned(P) then
  23. begin
  24. R.Next:=BaseRec;
  25. BaseRec:=@R;
  26. end;
  27. { nothing to do here
  28. else
  29. P:=@R; }
  30. end;
  31. begin
  32. RegisterType(Rtype1);
  33. RegisterType(RType2);
  34. end.