Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Pascal Programming/Getting started

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

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: What are and how to access and use files that are stored on a file system. How to install software on your OS operating system. How to edit plain text files using a text file editor such as vi(1), MS Microsoft Notepad or emacs(1). (Note: A LibreOffice or Word document is not a plain text file.) What is and how to use a CLI command-line interface, e. g. cmd.exe on MS MircoSoft Windows or the Linux terminal. 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. 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: Delphi, Free Pascal Compiler (FPC), and GNU Pascal Compiler (GPC). 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: compiler homepage platform license extra Delphi Embarcadero.com Windows proprietary commercial product, with IDE integrated development environment Free Pascal FreePascal.org many GPL supports multiple dialects GNU Pascal GNU-Pascal.de All that GCC GNU C compiler supports GPL considered abandoned since the 2010 Pascal-P SourceForge Public domainISO 7185 Level 0 only, must be compiled manually+ comparison of current Pascal compilers (current means since 2000) [Another comparison of Free Pascal and GNU Pascal] 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 integrated development environments provide means to write, compile, and run programs, and possibly find programming mistakes, all in one single program. Some IDEs integrated development environments are: Delphi fp(1), a text-mode IDE integrated development environmens that is shipped with the FPC Free Pascal compiler Lazarus, which is related to the FPC Free Pascal compiler, but more colorful An IDE integrated development environment may be overwhelming if you are just starting to program. In this case we suggest to stick to simple editors, such as nano(1). 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: online GDB tutorials point: https://www.tutorialspoint.com/compile_pascal_online.php [no link, because this is site is blacklisted] jDoodle RexTester IDE one All of these are powered by the FPC Free Pascal compiler. Be aware of what you enter on those sites. Working with this book Pascal Programming 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 Free Pascal compiler comes with the tool delp(1) that can delete all (Pascal-related) files other than source code files. Beginning