Hi I've created a custom class called Tperson. I'd like to convert this to a string so I can save it to an array( of type Tperson) and display in a string grid.
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TPerson = class(Tobject)
public
Fname : string;
Fage : integer;
Fweight : integer;
FHeight : integer;
FBMI : real;
function GetBMI(Fweight,Fheight:integer) : real;
procedure create(Fname:String;fage,fweight,fheight:integer);overload;
procedure Persontostr(Fname:string;Fage,Fheigth,Fweight:integer;FBMI:real);overload;
end;
implementation
{ TPerson }
procedure TPerson.create(Fname: String; fage, fweight, fheight: integer);
begin
Fname := '';
Fage := 0;
Fweight := 0;
FHeight := 0;
FBMI := 0;
end;
function TPerson.GetBMI(Fweight, Fheight: integer): real;
begin
result := (Fweight/Fheight) * (Fweight/Fheight);
end;
procedure TPerson.Persontostr(Fname:string;Fage,Fheigth,Fweight:integer;FBMI:real);
begin
end;
end.