如何在运行时设置数组长度?setLength(t.GetProperty( 'Propertys'),3); ????
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TSubProperty = Class
private
Fitem2: Integer;
Fitem1: String;
procedure Setitem1(const Value: String);
procedure Setitem2(const Value: Integer);
published
property item1:String read Fitem1 write Setitem1;
property item2:Integer read Fitem2 write Setitem2;
End;
TArraySubPropertys=array of TSubProperty;
TmyObject = Class
private
FPropertys: TArraySubPropertys;
procedure SetPropertys(const Value: TArraySubPropertys);
published
property Propertys:TArraySubPropertys read FPropertys write SetPropertys;
End;
TForm3 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private …Run Code Online (Sandbox Code Playgroud)