Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Arrays and Collections in Object Pascal
#1
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.
Also follow me on Youtube for videos about video games:
https://www.youtube.com/channel/UCxfkGVU...2mQ/videos
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Getting started with Object Pascal Qomplainerz 0 358 07-25-2023, 09:45 AM
Last Post: Qomplainerz
  Basic algorithms and Data Structures in Object Pascal Qomplainerz 0 375 07-25-2023, 09:44 AM
Last Post: Qomplainerz
  File I/O in Object Pascal Qomplainerz 0 328 07-25-2023, 09:44 AM
Last Post: Qomplainerz
  Exception handling in Object Pascal Qomplainerz 0 393 07-25-2023, 09:43 AM
Last Post: Qomplainerz
  Object-oriented concepts in Object Pascal Qomplainerz 0 345 07-25-2023, 09:43 AM
Last Post: Qomplainerz
  String manipulation in Object pascal Qomplainerz 0 322 07-25-2023, 09:41 AM
Last Post: Qomplainerz
  User-defined functions in Object Pascal Qomplainerz 0 337 07-25-2023, 09:40 AM
Last Post: Qomplainerz
  Control flow in Object Pascal Qomplainerz 0 348 07-25-2023, 09:40 AM
Last Post: Qomplainerz
  Basic Input and Output in Object Pascal Qomplainerz 0 341 07-25-2023, 09:39 AM
Last Post: Qomplainerz
  Datatypes and Variables in Object Pascal Qomplainerz 0 339 07-25-2023, 09:39 AM
Last Post: Qomplainerz

Forum Jump:


Users browsing this thread: 7 Guest(s)