Sign in Join
Wiki copytemporary

Basic Pascal Tutorial/Hello, World: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11Hello, World (author: Tao Yue, state: unchanged)
22
33In the short history of computer programming, one enduring tradition is that the first program in a new language is a "Hello, world" to the screen. So let's do that. Copy and paste the program below into your IDE or text editor, then compile and run it.
44
55If you have no idea how to do this, return to the Table of Contents. Earlier lessons explain what a compiler is, give links to downloadable compilers, and walk you through the installation of an open-source Pascal compiler on Windows.
66
77``` pascal
88program Hello;
99begin
1010 writeln ('Hello, world.');
1111end.
1212```
1313
1414The output on your screen should look like:
1515
16-`Hello, world.`
16+```
17+Hello, world.
18+```
1719
1820If you're running the program in an IDE, you may see the program run in a flash, then return to the IDE before you can see what happened. See the bottom of the previous lesson for the reason why. One suggested solution, adding a readln to wait for you to press Enter before ending the program, would alter the "Hello, world" program to become:
1921
2022``` pascal
2123program Hello;
2224begin
2325 writeln ('Hello, world.');
2426 readln;
2527end.
2628```
2729
2830---
2931*From the Free Pascal wiki, page "Basic Pascal Tutorial/Hello, World", as it stood on 2022-08-20 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history