Learning Pascal for fun

I am experimenting with old programming languages from the 20th century. My main focus is on teaching beginners to program with languages easier than Assembly. BASIC and Pascal are both older than C and so it is my duty to learn about them so I can make recommendations.

The following program is something I wrote as a basic outline of how variables in Pascal are defined and how a loop can be used. As I learn more I intend to translate some of my C programs into Pascal so I can share with others who appreciate this old language that is good but not as well known as most others.

program life;

var
 name:string;
 year:integer;
 age:integer;

begin
 name:='Chastity';
 year:=1987;
 age:=0;

 while year<=2026 do
 begin
  WriteLn('name=',name,' age=',age,' year=',year);
  year:=year+1;
  age:=age+1;
 end;

end.

(*
 fpc main.pas && ./main
*)

Comments

Please leave me any comments or questions you have! I will update posts if necessary based on user feedback!