16-02-2020, Saat: 23:28
(16-02-2020, Saat: 23:23)narkotik Adlı Kullanıcıdan Alıntı:procedure TForm1.BtnTestClick(Sender: TObject); Var xPersonArray : TPersonArray; xPointArray : TPointArray; PersonValue : TValue; PointValue : TValue; begin SetLength(xPersonArray,2); xPersonArray[0] := TPerson.Create; xPersonArray[0].FFirstName := 'S'; xPersonArray[0].FLastName := 'B'; xPersonArray[0].FAge := 25; xPersonArray[0].FSalary := 5000; xPersonArray[1] := TPerson.Create; xPersonArray[1].FFirstName := 'X'; xPersonArray[1].FLastName := 'Z'; xPersonArray[1].FAge := 55; xPersonArray[1].FSalary := 12500; PersonValue := TValue.From<TPersonArray>(xPersonArray); DoIt(PersonValue); SetLength(xPointArray,2); xPointArray[0] := TPoint.Create; xPointArray[0].X := 50; xPointArray[0].Y := 60; xPointArray[1] := TPoint.Create; xPointArray[1].X := 70; xPointArray[1].Y := 80; PointValue := TValue.From<TPointArray>(xPointArray); DoIt(PointValue); end; procedure TForm1.DoIt(const AValue: TValue); Var Ind : Integer; xPersonArray : TPersonArray; xPointArray : TPointArray; begin if AValue.IsType<TPersonArray> then begin xPersonArray := AValue.AsType<TPersonArray>; for Ind := Low(xPersonArray) to High(xPersonArray) do begin MemWrite.Lines.Add(xPersonArray[Ind].FFirstName); MemWrite.Lines.Add(xPersonArray[Ind].FLastName); MemWrite.Lines.Add(xPersonArray[Ind].FAge.ToString); MemWrite.Lines.Add(xPersonArray[Ind].FSalary.ToString); end; end else if AValue.IsType<TPointArray> then begin xPointArray := AValue.AsType<TPointArray>; for Ind := Low(xPointArray) to High(xPointArray) do begin MemWrite.Lines.Add(xPointArray[Ind].X.ToString); MemWrite.Lines.Add(xPointArray[Ind].Y.ToString); end; end end;
procedure'ün gövdesinde, parametre ile geçilen sınıflara bağımlı olmadan okunmalı.Yani procedure içinde TPersonArray, TPointArray, TPerson, TPoint bunlar geçmeyecek

