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

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -