QP School

Full Version: Arrays and Collections in Object Pascal
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
program ArrayExample;
begin
  // Variable declaration
  var
    numbers: array[0..4] of Integer := (1, 2, 3, 4, 5);
    matrix: array[0..2, 0..1] of Double := ((1.0, 2.0), (3.0, 4.0), (5.0, 6.0));
    names: array[0..1] of String := ('John', 'Amy');

  // Output to screen
  WriteLn('Numbers:', numbers);
  WriteLn('Matrix:', matrix);
  WriteLn('Names:', names);
end.