delphi - How to copy data from one class into another class -


How to copy data from one class to another using DELPHI using overlapping operator?

My dummy app goes like this:

  type TClass_A = class a: string; End; TClass_B = Classroom (TClass_A) b: String; End; Implementation Process TForm1.Button1Click (Sender: TObject); Var a: TClass_A; B: T Class_ B; Start one: = TClass_A.Create; B: = TClass_B.create; B: = A; // & lt; & Lt; - What code should be here? Do I Overload: = Operator? End;    

Assignment operator can not be overloaded in Delphi.

You will need to present a method to copy how this can be done. An example of this is TPersistent.Assign . The Virtual Assign method will be completely justified to get it from TPersistent and implementing the desired functionality.

Comments

Popular posts from this blog

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -