That brought back memories! Haven't coded in Pascal or Delphi in over 20 years (more like 25).
Looking at the code snippets, I want to mention something for anyone reading them and who might get the wrong impression.
Pascal (and any of its variants, including Delphi) is not case sensitive, unlike C/C++.
So, for example var person1: Person;
is syntactically identical to var person1: person;
in Pascal, and you can't have something like var person: Person;
, because you can't have the variable name identical to the record name (they are case insensitive). That's different than in C, where something like this is perfectly ok:
struct Person {
int age;
char name[50];
};
int main() {
struct Person person;
return 0;
}