persist.inc 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. {
  2. $Id$
  3. This file is part of the Free Component Library (FCL)
  4. Copyright (c) 1998 by the Free Pascal development team
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. {****************************************************************************}
  12. {* TPersistent *}
  13. {****************************************************************************}
  14. procedure TPersistent.AssignError(Source: TPersistent);
  15. Var SourceName : String;
  16. begin
  17. If Source<>Nil then
  18. SourceName:=Source.ClassName
  19. else
  20. SourceName:='Nil';
  21. Writeln ('Error assigning to ',ClassName,' from : ',SourceName);
  22. RunError(255);
  23. //!! raise EConvertError.CreateFmt (SAssignError,[SourceName,ClassName]);
  24. end;
  25. procedure TPersistent.AssignTo(Dest: TPersistent);
  26. begin
  27. Dest.AssignError(Self);
  28. end;
  29. procedure TPersistent.DefineProperties(Filer: TFiler);
  30. begin
  31. end;
  32. function TPersistent.GetOwner: TPersistent;
  33. begin
  34. Result:=Nil;
  35. end;
  36. destructor TPersistent.Destroy;
  37. begin
  38. Inherited Destroy;
  39. end;
  40. procedure TPersistent.Assign(Source: TPersistent);
  41. begin
  42. If Source<>Nil then
  43. Source.AssignTo(Self)
  44. else
  45. AssignError(Nil);
  46. end;
  47. function TPersistent.GetNamePath: string;
  48. Var OwnerName :String;
  49. begin
  50. Result:=ClassNAme;
  51. If GetOwner<>Nil then
  52. begin
  53. OwnerName:=GetOwner.GetNamePath;
  54. If OwnerName<>'' then Result:=OwnerName+'.'+Result;
  55. end;
  56. end;
  57. {
  58. $Log$
  59. Revision 1.2 1998-05-27 12:22:14 michael
  60. + Implemented TPersistent
  61. Revision 1.1 1998/05/04 14:30:12 michael
  62. * Split file according to Class; implemented dummys for all methods, so unit compiles.
  63. }