how to receive panel values for an array of strings?

-1

How to get panel values with edits for an array of strings? I need 10 records to be typed into edits that are inside a panel, and thus save to an array of strings or integers.

    
asked by anonymous 20.05.2015 / 20:48

1 answer

2
procedure Form1.Button1Click(Sender: TObject)
var
  //declaro o array
  valores: array of string;
begin
  //Altero a quantidade de items do array, no caso 10.
  SetLength(valores, 10);

  //Passo o valor dos edits para os itens do array
  //NOTA: Arrays começam pelo índice 0. No nosso caso os itens do nosso array
  //vão de 0 até 9.
  valores[0] := Edit1.Text;
  valores[1] := Edit2.Text;
  ...
  valores[9] := Edit10.Text;
end;
    
01.06.2015 / 01:39