persist.inc 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. {
  2. $Id$
  3. This file is part of the Free Component Library (FCL)
  4. Copyright (c) 1999-2000 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. raise EConvertError.CreateFmt (SAssignError,[SourceName,ClassName]);
  23. end;
  24. procedure TPersistent.AssignTo(Dest: TPersistent);
  25. begin
  26. Dest.AssignError(Self);
  27. end;
  28. procedure TPersistent.DefineProperties(Filer: TFiler);
  29. begin
  30. end;
  31. function TPersistent.GetOwner: TPersistent;
  32. begin
  33. Result:=Nil;
  34. end;
  35. destructor TPersistent.Destroy;
  36. begin
  37. Inherited Destroy;
  38. end;
  39. procedure TPersistent.Assign(Source: TPersistent);
  40. begin
  41. If Source<>Nil then
  42. Source.AssignTo(Self)
  43. else
  44. AssignError(Nil);
  45. end;
  46. function TPersistent.GetNamePath: string;
  47. Var OwnerName :String;
  48. begin
  49. Result:=ClassNAme;
  50. If GetOwner<>Nil then
  51. begin
  52. OwnerName:=GetOwner.GetNamePath;
  53. If OwnerName<>'' then Result:=OwnerName+'.'+Result;
  54. end;
  55. end;
  56. {
  57. $Log$
  58. Revision 1.2 2000-07-13 11:32:59 michael
  59. + removed logs
  60. }