Pascal Programming/Getting started

Welcome to the WikiBook Pascal Programming! This book will teach you to program in Pascal, a high-level, human-readable programming language. High-level means there are abstract concepts, such as data types or control structures, which the microprocessor does not know, but the programming language provides this abstraction level. Human-readable refers to the fact that a program written in Pascal can be read like (very simple, “Neanderthalian”) English phrases. This makes Pascal particularly suitable for beginners and we hope you will appreciate this.

Prerequisites
In order to successfully use this book you need to already know a few things: Covering these topics would be out of this book’s scope. Pascal only assumes there is some user interface (i. e. a console) and there are external entities (this usually refers to “files”). Every system, however, implements them differently, so we cannot explain them to you, nor can we say at what point you have learned enough to continue with this book.
 * What are and how to access and use files that are stored on a file system.
 * How to install software on your OS.
 * How to edit plain text files using a text file editor such as, MS Notepad or  . (Note: A LibreOffice or Word document is not a plain text file.)
 * What is and how to use a CLI, e. g.  on MS Windows or the Linux terminal.

Required software
Pascal is a compiled language. That means, you need a tool, a computer program, that “translates” the human-readable Pascal source code into a sequence of Bytes the microprocessor understands. This work is done by a compiler.

Prior the 2000s there were many different compilers, but (as in 2020) there are primarily three Pascal compilers:

The authors suggest FPC, due to its availability (on many platforms, and free of charge) and continuous progress in development. This table provides more information about each compiler: [ Another comparison of Free Pascal and GNU Pascal]
 * Delphi,
 * Free Pascal Compiler (FPC), and
 * GNU Pascal Compiler (GPC).

Furthermore, you will need a program you can edit source code files with. This can be any editor (that can edit and save plain text files), but there are also dedicated suites available for programming purposes. These are called integrated development environments, in short IDE. Such IDEs provide means to write, compile, and run programs, and possibly find programming mistakes, all in one single program. Some IDEs are:
 * Delphi
 * , a text-mode IDE that is shipped with the FPC
 * Lazarus, which is related to the FPC, but more colorful

An IDE may be overwhelming if you are just starting to program. In this case we suggest to stick to simple editors, such as. It has an easy to understand user guidance system allowing you to delve in into programming right away.

A temporary alternative for your first steps may also be websites: All of these are powered by the FPC. Be aware of what you enter on those sites.
 * online GDB
 * tutorials point: https://www.tutorialspoint.com/compile_pascal_online.php [no link, because this is site is blacklisted]
 * jDoodle
 * RexTester
 * IDE one

Working with this book
We suggest to create a dedicated folder for your programming exercises. Keep your source code files until you have finished with this book. If your folder becomes cluttered with all kinds of files, the FPC comes with the tool  that can delete all (Pascal-related) files other than source code files.