Return number of rows or columns of an array

0

I have an array like this in Delphi XE8: Matriz[2][3] .

I would like to know what method I can use to return the number of rows or columns in this array, my idea is to loop with 2 for 'if I scroll through the array elements by inserting them into a table in DataBase and then retrieves them in a report with the TfrxDbDataset component.

    
asked by anonymous 06.10.2017 / 20:44

1 answer

1

For you to walk through a Array Multi dimensional it is necessary to make two laços de repetição , follow an example:

var
  Matriz: Array[0..1][0..2] of String;
  i, i1: Integer;
begin
  //Laço de repetição para percorrer as linhas, i representará a linha
  for i := 0 To High(Matriz) do
    begin
      //Laço de repetição para representar as colunas, i1 representará a coluna
      for i1 := 0 To High(Matriz[i]) do
        begin
          Matriz[i][i1]; //Aqui estará o conteúdo de cada espaço do seu Array
        end;
    end;
end;
    
06.10.2017 / 20:55