Вниз
Скачать: CL | DM;

О заполнении массива   Найти похожие ветки 

 
Eraser   (2001-12-29 14:15) [0]

если хочу задать массив через свойство и заполнить его, то StackOverflow .Поскажите:

type
TForm1 = class(TForm)
Button1: TButton;

procedure Button1Click(Sender: TObject);
private
function Getput(num: integer): string;
procedure Setput(num: integer; const Value: string);
private
property put[num:integer]:string read Getput write Setput;
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

{ TForm1 }

function TForm1.Getput(num: integer): string;
begin
Result:=put[num];
end;

procedure TForm1.Setput(num: integer; const Value: string);
begin
put[num]:=value;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
setput(1,"0");
end;

end.


 
Алексей Петров ©   (2001-12-29 14:40) [1]

У тебя бесконечная рекурсия получилась

SetPut вызывает SetPut
и GetPut - себя.


 
panov ©   (2001-12-29 14:46) [2]

У тебя половины кода не хватает.
Где массив, который ты хочешь заполнить?
Посмотри на
procedure TForm1.Button1Click(Sender: TObject);
setput(1,"0");
Должно быть:
MyArray[num] := Value;

----------------------





Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.006 c
3-52491
ripp
2001-12-15 15:21
2002.01.17
Как наити строку


14-52649
vic_vm
2001-11-21 13:48
2002.01.17
Плакат


1-52582
Sym
2001-12-19 16:06
2002.01.17
Народ помогите!!!!!!!!!!!!!! За ранее СПАСИБО


1-52573
Lamok (real)
2001-12-28 23:23
2002.01.17
EStringlistError


1-52544
Kroal
2001-12-28 06:58
2002.01.17
TButton




   Наверх