5
With the following code, I create an X amount of edits:
var
x : integer;
var2: integer;
begin
var2 := strtoint(edit2.Text);
for x := 1 to var2 do
begin
ArrayEdit[x] := TEdit.Create(Self);
ArrayEdit[x].Parent:= Self;
ArrayEdit[x].Left := 83 + x * 50;
ArrayEdit[x].Top := 130;
ArrayEdit[x].Width := 41;
ArrayEdit[x].Height :=24;
ArrayEdit[x].Name := 'edit'+ inttostr(x+20);
ArrayEdit[x].Text := '';
ArrayEdit[x].ShowHint:=true;
ArrayEdit[x].Hint:='edit'+ inttostr(x+20);
end;
end;
My question is the following: I need to take the values of each created Dit, and receive it in a variable to be used later. How can I do this?
Receive in a variable? Wouldn’t it be better to create an array to store since there are several Edits. Unless you perform some type of run-time operation including and using only one variable.
– Giancarlo Abel Giulian
Yes, I ended up thinking better my idea was the following: add the Edit in another vector, and then assign to a variable. Because I have to use these values that will be written in Edit created at runtime on a Tmemo.
– Guilherme Lima
And already implemented? It worked?
– Giancarlo Abel Giulian
It worked, thank you.
– Guilherme Lima
If you want you can put the answer here in your own question so that everyone knows what you have done, your question has had 3 positive votes so far may be helping someone (;
– Giancarlo Abel Giulian