terecs_u1.pp 722 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. { %norun }
  2. unit terecs_u1;
  3. {$mode delphi}
  4. interface
  5. type
  6. HWND = integer;
  7. TFoo = record
  8. hWnd : HWND;
  9. private
  10. F1: Integer;
  11. F2: Byte;
  12. public
  13. type
  14. TBar = Integer;
  15. const
  16. C: TBar = 1;
  17. var
  18. F3: TBar;
  19. F4: Byte;
  20. class var
  21. F5: TBar;
  22. function Test(n: TBar): TBar;
  23. class function Test1(n: TBar): TBar;
  24. class constructor Create;
  25. class destructor Destroy;
  26. end;
  27. implementation
  28. function TFoo.Test(n: TBar): TBar;
  29. begin
  30. Result := F3 + F4 + n;
  31. end;
  32. class function TFoo.Test1(n: TBar): TBar;
  33. begin
  34. Result := C + n;
  35. end;
  36. class constructor TFoo.Create;
  37. begin
  38. F5 := 6;
  39. end;
  40. class destructor TFoo.Destroy;
  41. begin
  42. WriteLn('TFoo.Destroy');
  43. end;
  44. end.