https://wiki.freepascal.org/api.php?action=feedcontributions&user=Wsmekal&feedformat=atomFree Pascal wiki - User contributions [en]2024-03-29T09:03:13ZUser contributionsMediaWiki 1.35.6https://wiki.freepascal.org/index.php?title=Basic_Pascal_Tutorial/Chapter_1/Identifiers&diff=150674Basic Pascal Tutorial/Chapter 1/Identifiers2022-02-07T20:59:18Z<p>Wsmekal: Consistant Font face.</p>
<hr />
<div>{{Identifiers}}<br />
{{TYNavigator|Program_Structure|Constants}}<br />
<br />
1B - Identifiers (author: Tao Yue, state: changed)<br />
<br />
Identifiers are names that allow you to reference stored values, such as variables and constants. Also, every program must be identified (get it?) by an identifier.<br />
<br />
Rules for identifiers:<br />
<br />
* Must begin with a letter (a..z or A..Z, Pascal is case insensitive) from the English alphabet or an underscore (_). <br />
* Can be followed by zero or more letters (a..Z), digits (0..9), or underscores (_), in any combination.<br />
* Cannot be the same as a [[Keyword|keyword]] such as {{HL|begin}}, {{HL|for}}, {{HL|case}}, {{HL|absolute}} etc.<br />
* May not contain special characters, such as:<br />
~ ! @ # $ % ^ & * ( ) + ` - = { } [ ] : " ; ' < > ? , . / | \ (or the space character)<br />
<br />
=Reserved words=<br />
Several identifiers are reserved in Pascal -- you cannot use them as your own identifiers. <br />
According to the [http://lazarus-ccr.sourceforge.net/fpcdoc/ref/ref.html FPC Reference] they are grouped in:<br />
* Turbo Pascal reserved words<br />
* Delphi reserved words<br />
* FPC reserved words<br />
<br />
===Turbo Pascal reserved words===<br />
{| style="font-weight:bold; background-color:#f5f5f5" cellspacing=5<br />
|absolute || and || array || asm || begin || break || case || const<br />
|-<br />
|constructor||continue || destructor || div || do || downto||else || end<br />
|-<br />
| file || for || function || goto || if||implementation ||in ||inherited<br />
|-<br />
| inline || interface || label || mod || nil || not || object|| of<br />
|-<br />
| on || operator || or || packed || procedure || program || record || reintroduce<br />
|-<br />
| repeat || self || set || shl || shr || string || then || to <br />
|-<br />
| type || unit || until || uses || var || while || with || xor <br />
|}<br />
<br />
===Delphi reserved words===<br />
The Delphi (II) reserved words are the same as the pascal ones, plus the following ones:<br />
{| style="font-weight:bold; background-color:#f5f5f5" cellspacing=5<br />
| as || class || except || exports || finalization || finally || initialization <br />
|-<br />
| is || library || on || property || raise || threadvar || try <br />
|}<br />
<br />
===Free Pascal reserved words===<br />
On top of the Turbo Pascal and Delphi reserved words, Free Pascal also considers the following as reserved words:<br />
{| style="font-weight:bold; background-color:#f5f5f5" cellspacing=5<br />
| dispose || exit || false || new || true || break || continue<br />
|}<br />
<br />
Also, Pascal has several pre-defined identifiers. You can replace them with your own definitions, but then you'd be deleting part of the functionality of Pascal.<br />
{| style="font-weight:bold; background-color:#f5f5f5" cellspacing=5<br />
|abs ||arctan ||boolean ||char ||cos ||dispose ||eof ||eoln<br />
|-<br />
|exp ||false ||input ||integer ||ln ||maxint ||new ||odd<br />
|-<br />
|ord ||output ||pack ||page ||pred ||read ||readln ||real<br />
|-<br />
|reset ||rewrite ||round ||sin ||sqr ||sqrt ||succ ||text<br />
|-<br />
|true ||trunc write ||writeln<br />
|}<br />
Pascal is not case sensitive! {{TT|MyProgram}}, {{TT|MYPROGRAM}}, and {{TT|mYpRoGrAm}} are equivalent. But for readability purposes, it is a good idea to use meaningful capitalization!<br />
<br />
There are two possible methods you could choose to apply to your identifiers: CamelCase and underscore as space. CamelCase, as it appears, means that separate words in an identifier are capitalized, so that you have {{TT|newPerson}} or {{TT|NewPerson}} instead of {{TT|newperson}}. Using underscore as space means you separate words in an identifier with underscores, so that you have {{TT|new_person}} instead of {{TT|newperson}}. Or you could combine the two, so that you have {{TT|new_Person}} or {{TT|New_Person|}} instead of {{TT|newperson}}.<br />
<br />
Identifiers can be any length, but many Pascal compilers will only look at the first 32 characters or so. That is,<br />
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFAlphaBeta<br />
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGammaDelta<br />
may be equivalent to some Pascal compilers because the differences begin in the 33rd character. Free Pascal limits [http://www.freepascal.org/docs-html/3.0.0/ref/refse4.html#x16-150001.4 identifiers] to 127 characters.<br />
<br />
This is extremely generous. The original Pascal compiler for the CDC 6000 mainframe only noticed the first 10 characters of an identifier. This was because the CDC had a 60 bit word, and by using 6 bit characters (all upper case letters plus digits and some punctuation) an identifier could fit in one word. You could have more than 10 characters in an identifier, but only the first 10 counted, so {{TT|ThisIsObviouslyAVeryLongNamw}} and {{TT|ThisIsObviouslyAnEvenLongerName}} would be considered the same.<br />
<br />
To make your code compilable by all compilers, use a reasonable length for identifiers -- up to 15 characters. That way, you'll also save on typing.<br />
<br />
While it is a good idea to make identifiers to be mnemonic with the use of longer names, there is nothing wrong with using very short identifiers in specific uses. it is extremely common to use <tt>I, J, </tt>and <tt>K</tt> as the control variable in a [[For|for]] loop.<br />
<br />
<br />
{{TYNavigator|Program_Structure|Constants}}</div>Wsmekalhttps://wiki.freepascal.org/index.php?title=Basic_Pascal_Tutorial/Chapter_1/Identifiers&diff=150673Basic Pascal Tutorial/Chapter 1/Identifiers2022-02-07T20:58:25Z<p>Wsmekal: Removed "<" (typo).</p>
<hr />
<div>{{Identifiers}}<br />
{{TYNavigator|Program_Structure|Constants}}<br />
<br />
1B - Identifiers (author: Tao Yue, state: changed)<br />
<br />
Identifiers are names that allow you to reference stored values, such as variables and constants. Also, every program must be identified (get it?) by an identifier.<br />
<br />
Rules for identifiers:<br />
<br />
* Must begin with a letter (a..z or A..Z, Pascal is case insensitive) from the English alphabet or an underscore (_). <br />
* Can be followed by zero or more letters (a..Z), digits (0..9), or underscores (_), in any combination.<br />
* Cannot be the same as a [[Keyword|keyword]] such as {{HL|begin}}, {{HL|for}}, {{HL|case}}, {{HL|absolute}} etc.<br />
* May not contain special characters, such as:<br />
~ ! @ # $ % ^ & * ( ) + ` - = { } [ ] : " ; ' < > ? , . / | \ (or the space character)<br />
<br />
=Reserved words=<br />
Several identifiers are reserved in Pascal -- you cannot use them as your own identifiers. <br />
According to the [http://lazarus-ccr.sourceforge.net/fpcdoc/ref/ref.html FPC Reference] they are grouped in:<br />
* Turbo Pascal reserved words<br />
* Delphi reserved words<br />
* FPC reserved words<br />
<br />
===Turbo Pascal reserved words===<br />
{| style="font-weight:bold; background-color:#f5f5f5" cellspacing=5<br />
|absolute || and || array || asm || begin || break || case || const<br />
|-<br />
|constructor||continue || destructor || div || do || downto||else || end<br />
|-<br />
| file || for || function || goto || if||implementation ||in ||inherited<br />
|-<br />
| inline || interface || label || mod || nil || not || object|| of<br />
|-<br />
| on || operator || or || packed || procedure || program || record || reintroduce<br />
|-<br />
| repeat || self || set || shl || shr || string || then || to <br />
|-<br />
| type || unit || until || uses || var || while || with || xor <br />
|}<br />
<br />
===Delphi reserved words===<br />
The Delphi (II) reserved words are the same as the pascal ones, plus the following ones:<br />
{| style="font-weight:bold; background-color:#f5f5f5" cellspacing=5<br />
| as || class || except || exports || finalization || finally || initialization <br />
|-<br />
| is || library || on || property || raise || threadvar || try <br />
|}<br />
<br />
===Free Pascal reserved words===<br />
On top of the Turbo Pascal and Delphi reserved words, Free Pascal also considers the following as reserved words:<br />
{| style="font-weight:bold; background-color:#f5f5f5" cellspacing=5<br />
| dispose || exit || false || new || true || break || continue<br />
|}<br />
<br />
Also, Pascal has several pre-defined identifiers. You can replace them with your own definitions, but then you'd be deleting part of the functionality of Pascal.<br />
{| style="font-weight:bold; background-color:#f5f5f5" cellspacing=5<br />
|abs ||arctan ||boolean ||char ||cos ||dispose ||eof ||eoln<br />
|-<br />
|exp ||false ||input ||integer ||ln ||maxint ||new ||odd<br />
|-<br />
|ord ||output ||pack ||page ||pred ||read ||readln ||real<br />
|-<br />
|reset ||rewrite ||round ||sin ||sqr ||sqrt ||succ ||text<br />
|-<br />
|true ||trunc write ||writeln<br />
|}<br />
Pascal is not case sensitive! {{TT|MyProgram}}, {{TT|MYPROGRAM}}, and {{TT|mYpRoGrAm}} are equivalent. But for readability purposes, it is a good idea to use meaningful capitalization!<br />
<br />
There are two possible methods you could choose to apply to your identifiers: CamelCase and underscore as space. CamelCase, as it appears, means that separate words in an identifier are capitalized, so that you have {{TT|newPerson}} or {{TT|NewPerson}} instead of {{TT|newperson}}. Using underscore as space means you separate words in an identifier with underscores, so that you have {{TT|new_person}} instead of {{TT|newperson}}. Or you could combine the two, so that you have {{TT|new_Person}} or {{TT|New_Person|}} instead of {{TT|newperson}}.<br />
<br />
Identifiers can be any length, but many Pascal compilers will only look at the first 32 characters or so. That is,<br />
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFAlphaBeta<br />
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGammaDelta<br />
may be equivalent to some Pascal compilers because the differences begin in the 33rd character. Free Pascal limits [http://www.freepascal.org/docs-html/3.0.0/ref/refse4.html#x16-150001.4 identifiers] to 127 characters.<br />
<br />
This is extremely generous. The original Pascal compiler for the CDC 6000 mainframe only noticed the first 10 characters of an identifier. This was because the CDC had a 60 bit word, and by using 6 bit characters (all upper case letters plus digits and some punctuation) an identifier could fit in one word. You could have more than 10 characters in an identifier, but only the first 10 counted, so {{TT|ThisIsObviouslyAVeryLongNamw}} and {{TT|ThisIsObviouslyAnEvenLongerName}} would be considered the same.<br />
<br />
To make your code compilable by all compilers, use a reasonable length for identifiers -- up to 15 characters. That way, you'll also save on typing.<br />
<br />
While it is a good idea to make identifiers to be mnemonic with the use of longer names, there is nothing wrong with using very short identifiers in specific uses. it is extremely common to use <tt>I, J</tt>, and <tt>K</tt> as the control variable in a [[For|for]] loop.<br />
<br />
<br />
{{TYNavigator|Program_Structure|Constants}}</div>Wsmekalhttps://wiki.freepascal.org/index.php?title=Basic_Pascal_Tutorial/Compilers/de&diff=150523Basic Pascal Tutorial/Compilers/de2022-02-03T09:19:42Z<p>Wsmekal: Corrected links.</p>
<hr />
<div>{{Compilers_ty}}<br />
{{TYNavigator|Pascal_History|Hello,_World}}<br />
<br />
<br />
== Pascal Compiler ==<br />
<br />
''(Autor: Tao Yue, Zustand: Übersetzung ins Deutsche)''<br />
<br />
<br />
Dieses Dokument erklärt die Grundlagen über Compiler sowie Links zu bekannten Pascal-Compilern und erklärt, wie man Free Pascal einrichtet.<br />
<br />
===Über Computersprachen und Compiler===<br />
Wenn man über Computersprachen spricht, gibt es grundsätzlich drei wichtige Begriffe, die verwendet werden.<br />
<br />
# '''Maschinensprache''' -- aktueller Binärcode, der grundlegende Anweisungen an die CPU des Computers gibt. Dies sind in der Regel sehr einfache Befehle wie das Hinzufügen von zwei Zahlen oder das Verschieben von Daten von einem Speicherplatz zum anderen.<br />
# '''Assemblersprache''' -- eine Möglichkeit für Menschen, Computer direkt zu programmieren, ohne sich Binärzahlen merken zu müssen. Es gibt eine Eins-zu-Eins-Korrespondenz mit dem Maschinencode. Zum Beispiel sind in der Intel x86-Maschinensprache ADD und MOV Mnemonics für die Additions- und Verschiebeoperationen.<br />
# '''High-level Sprachen''' -- erlaubt es Menschen, komplexe Programme zu schreiben, ohne Schritt für Schritt zu gehen. Hochsprachen sind Pascal, C, C++, FORTRAN, Java, Visual Basic, C#, Java und viele mehr. Ein Befehl in einer Hochsprache, wie das Schreiben einer Zeichenkette in eine Datei, kann in Dutzende oder sogar Hunderte von Maschinensprachenanweisungen übersetzt werden.<br />
<br />
Mikroprozessoren können nur Maschinensprachprogramme direkt ausführen. Assemblerprogramme werden zusammengestellt oder in die Maschinensprache übersetzt. Ebenso müssen Programme, die in Hochsprachen wie Pascal geschrieben wurden, in die Maschinensprache übersetzt werden, bevor sie ausgeführt werden können. Um diese Übersetzung zu machen, muss man ein Programm kompilieren.<br />
<br />
Das Programm, das die Übersetzung durchführt, wird als '''Compiler''' bezeichnet. Dieses Programm ist ziemlich komplex, da es nicht nur Maschinensprachenbefehle aus Codezeilen erzeugt, sondern oft auch den Code optimiert, um schneller zu laufen, Fehlerkorrekturcode hinzufügt und den Code mit Unterprogrammen verknüpft, die an anderer Stelle gespeichert sind. Wenn Sie beispielsweise dem Computer sagen, dass er etwas auf den Bildschirm drucken soll, übersetzt der Compiler dies als einen Aufruf an ein vorgefertigtes Modul. Ihr Code muss dann mit dem Code verknüpft werden, den der Compilerhersteller zur Verfügung stellt, bevor ein ausführbares Programm entsteht.<br />
<br />
Bei Hochsprachen gibt es wieder drei Grundbegriffe zu beachten:<br />
<br />
# Source-Code -- den Code, den Sie schreiben. Diese hat typischerweise eine Erweiterung, die die verwendete Sprache angibt. Zum Beispiel endet der Pascal-Quellcode normalerweise mit "<tt>.pas</tt>" und der C++-Code endet normalerweise mit "<tt>.cpp</tt>".<br />
# Object-Code -- das Ergebnis der Kompilierung. Der Objektcode enthält in der Regel nur einen Baustein eines Programms und kann noch nicht ausgeführt werden, da er unvollständig ist. Auf DOS/Windows-Systemen hat dies normalerweise die Erweiterung "<tt>.obj</tt>".<br />
# Ausführbarer-Code -- das Endergebnis. Alle für die Funktion eines Programms notwendigen Objektcode-Module sind miteinander verknüpft. Auf DOS/Windows-Systemen hat dies normalerweise die Erweiterung "<tt>.exe</tt>".<br />
<br />
===Mehr über Compiler===<br />
Der De-facto-Standard in DOS- und Windows-basierten Pascal-Compilern ist Borland Pascal. Bevor es herauskam, waren die meisten Pascal-Compiler ungeschickt und langsam, vom Pascal-Standard abgewichen und kosteten mehrere hundert Dollar. 1984 führte Borland Turbo Pascal ein, das für weniger als 100 Dollar verkauft wurde, eine Größenordnung schneller kompilierte als bestehende Compiler und mit einer Fülle von Quellcode und Hilfsprogrammen ausgestattet war.<br />
<br />
Dieses Produkt war ein großer Erfolg und war fast ein Jahrzehnt lang bekannt. Aber in den 1990er Jahren wurde die Welt auf Windows umgestellt. 1993 erschien die letzte Version von Turbo Pascal, Version 7 für DOS. Danach brach die Nachfrage nach DOS-Programmen ein und Borland (kurz Inprise genannt) konzentrierte sich auf die Produktion von Windows IDE/Compilern (z.B. Delphi). Später verkaufte Borland seine Compiler an Embarcadero, die Delphi immer noch regelmäßig aktualisieren.<br />
<br />
Dieses Tutorial behandelt nur die konsolenbasierte Programmierung, bei der der Computer Datenzeilen auf den Bildschirm druckt und der Benutzer über eine Tastatur mit dem Programm interagiert. Ziel des Tutorials ist es, das Programmieren in Pascal zu lehren. Sobald Sie das gelernt haben, können Sie sich einfach ein Nachschlagewerk oder eine andere Webseite anschauen und Grafiken und Fenstersysteme selbst in die Hand nehmen.<br />
<br />
Obwohl alte kommerzielle Pascal-Compiler oft zum Download zur Verfügung stehen (z.B. Turbo Pascal 5.5 aus dem [https://web.archive.org/web/20031206003232/http://bdn.borland.com/museum Borland Museum] und Symantec Think Pascal (Macintosh), siehe The Free Country's[http://www.thefreecountry.com/compilers/pascal.shtml Free Pascal Compiler List]), haben sich die Computer seit den 1980er und frühen 1990er Jahren stark weiterentwickelt. Wir haben keine 8.3-Dateinamen mehr unter DOS oder nicht präventives Multitasking unter Mac OS. Einen alten Compiler zu benutzen macht Spaß im gleichen Sinne wie ein altes Spiel auf einem Emulator zu spielen, aber die Open-Source-Bewegung hat gute Compiler für moderne Betriebssysteme hervorgebracht, und ein Anfänger wird es viel einfacher finden, diese zu benutzen.<br />
<br />
===Open Source Compiler===<br />
Die beiden wichtigsten Open-Source-Compiler-Projekte sind:<br />
* [http://www.gnu-pascal.de GNU Pascal]<br />
* [https://www.freepascal.org Free Pascal]<br />
<br />
Free Pascal wird allgemein als freundlicher für Anfänger angesehen und strebt danach, Borland Pascal in vielerlei Hinsicht zu emulieren, obwohl beide zum Erlernen von Pascal gut geeignet sind.<br />
<br />
Da die meisten Benutzer dieses Tutorials mit Windows arbeiten werden, hier ist, wie Sie Free Pascal einrichten und zu dem Punkt kommen, an dem Sie ein Programm auf einem modernen Windows-Betriebssystem kompilieren:<br />
<br />
# Lade den Win32 installer für Free Pascal unter [https://www.freepascal.org/download.html Free Pascal Download-Seite] herunter.<br />
# Führe die soeben heruntergeladene Datei aus und folge den Assistenten, um Free Pascal einzurichten.<br />
# Öffne Free Pascal über die Verknüpfung (befindet es sich standardmäßig in Start -> Free Pascal.<br />
# Gebe einen Programmcode ein (springe zur [[Hello%2C_World/de|nächsten Lektion]] um ein "Hello, world." Programm zu sehen).<br />
# Speicher die Datei über File-Save As ...<br />
# Starte das Programm über das Menü Ausführen. Dadurch wird das Programm automatisch kompiliert, wenn Du Änderungen vorgenommen hast, und das Programm ausgeführt. Das Programm wird auch ohne Kompilierung ausgeführt, wenn Du seit der letzten Kompilierung keine Änderungen vorgenommen hast.<br />
<br />
Bei Programmen, die keine Benutzereingaben erwarten, wird das Programm auf einem schwarzen Bildschirm angezeigt. Aber das Programm ist im Handumdrehen fertig und Du kehrst zur IDE zurück, ohne die Ergebnisse deiner Arbeit zu sehen. Es gibt zwei Möglichkeiten, dies zu umgehen:<br />
<br />
* Wähle den "User Screen" aus dem Debug-Menü, um die Ergebnisse des Programms zu sehen.<br />
* Füge am Ende jedes Programms eine readln-Anweisung hinzu. Dadurch wartet das Programm darauf, dass der Benutzer die Eingabetaste drückt, bevor das Programm beendet wird und zur IDE zurückkehrt.<br />
[[Image:Userscreen.png]]<br />
<br />
Beachte, dass eine.exe-Datei in dem Verzeichnis erstellt wurde, in dem Du Dein Programm gespeichert hast. Dies ist die ausführbare Datei. Du kannst zur Eingabeaufforderung gehen, in das Verzeichnis wechseln und diese ausführbare Datei direkt ausführen. Du kannst es auch im Windows Explorer doppelklicken (und es blinkt immer noch schnell, wenn es ohne Benutzereingabe endet).<br />
<br />
=== See also ===<br />
* [[Control Pascal Tutorial]] - eine einfache Möglichkeit, ohne Installation zu beginnen<br />
* [[How to start]] - ein anderer Weg, um mit einer Installation zu beginnen<br />
<br />
{{TYNavigator|Pascal_History|Hello,_World}}</div>Wsmekalhttps://wiki.freepascal.org/index.php?title=Basic_Pascal_Tutorial/Compilers/de&diff=150522Basic Pascal Tutorial/Compilers/de2022-02-03T09:19:08Z<p>Wsmekal: Link to turbo pascal download in webarchive changed.</p>
<hr />
<div>{{Compilers_ty}}<br />
{{TYNavigator|Pascal_History|Hello,_World}}<br />
<br />
<br />
== Pascal Compiler ==<br />
<br />
''(Autor: Tao Yue, Zustand: Übersetzung ins Deutsche)''<br />
<br />
<br />
Dieses Dokument erklärt die Grundlagen über Compiler sowie Links zu bekannten Pascal-Compilern und erklärt, wie man Free Pascal einrichtet.<br />
<br />
===Über Computersprachen und Compiler===<br />
Wenn man über Computersprachen spricht, gibt es grundsätzlich drei wichtige Begriffe, die verwendet werden.<br />
<br />
# '''Maschinensprache''' -- aktueller Binärcode, der grundlegende Anweisungen an die CPU des Computers gibt. Dies sind in der Regel sehr einfache Befehle wie das Hinzufügen von zwei Zahlen oder das Verschieben von Daten von einem Speicherplatz zum anderen.<br />
# '''Assemblersprache''' -- eine Möglichkeit für Menschen, Computer direkt zu programmieren, ohne sich Binärzahlen merken zu müssen. Es gibt eine Eins-zu-Eins-Korrespondenz mit dem Maschinencode. Zum Beispiel sind in der Intel x86-Maschinensprache ADD und MOV Mnemonics für die Additions- und Verschiebeoperationen.<br />
# '''High-level Sprachen''' -- erlaubt es Menschen, komplexe Programme zu schreiben, ohne Schritt für Schritt zu gehen. Hochsprachen sind Pascal, C, C++, FORTRAN, Java, Visual Basic, C#, Java und viele mehr. Ein Befehl in einer Hochsprache, wie das Schreiben einer Zeichenkette in eine Datei, kann in Dutzende oder sogar Hunderte von Maschinensprachenanweisungen übersetzt werden.<br />
<br />
Mikroprozessoren können nur Maschinensprachprogramme direkt ausführen. Assemblerprogramme werden zusammengestellt oder in die Maschinensprache übersetzt. Ebenso müssen Programme, die in Hochsprachen wie Pascal geschrieben wurden, in die Maschinensprache übersetzt werden, bevor sie ausgeführt werden können. Um diese Übersetzung zu machen, muss man ein Programm kompilieren.<br />
<br />
Das Programm, das die Übersetzung durchführt, wird als '''Compiler''' bezeichnet. Dieses Programm ist ziemlich komplex, da es nicht nur Maschinensprachenbefehle aus Codezeilen erzeugt, sondern oft auch den Code optimiert, um schneller zu laufen, Fehlerkorrekturcode hinzufügt und den Code mit Unterprogrammen verknüpft, die an anderer Stelle gespeichert sind. Wenn Sie beispielsweise dem Computer sagen, dass er etwas auf den Bildschirm drucken soll, übersetzt der Compiler dies als einen Aufruf an ein vorgefertigtes Modul. Ihr Code muss dann mit dem Code verknüpft werden, den der Compilerhersteller zur Verfügung stellt, bevor ein ausführbares Programm entsteht.<br />
<br />
Bei Hochsprachen gibt es wieder drei Grundbegriffe zu beachten:<br />
<br />
# Source-Code -- den Code, den Sie schreiben. Diese hat typischerweise eine Erweiterung, die die verwendete Sprache angibt. Zum Beispiel endet der Pascal-Quellcode normalerweise mit "<tt>.pas</tt>" und der C++-Code endet normalerweise mit "<tt>.cpp</tt>".<br />
# Object-Code -- das Ergebnis der Kompilierung. Der Objektcode enthält in der Regel nur einen Baustein eines Programms und kann noch nicht ausgeführt werden, da er unvollständig ist. Auf DOS/Windows-Systemen hat dies normalerweise die Erweiterung "<tt>.obj</tt>".<br />
# Ausführbarer-Code -- das Endergebnis. Alle für die Funktion eines Programms notwendigen Objektcode-Module sind miteinander verknüpft. Auf DOS/Windows-Systemen hat dies normalerweise die Erweiterung "<tt>.exe</tt>".<br />
<br />
===Mehr über Compiler===<br />
Der De-facto-Standard in DOS- und Windows-basierten Pascal-Compilern ist Borland Pascal. Bevor es herauskam, waren die meisten Pascal-Compiler ungeschickt und langsam, vom Pascal-Standard abgewichen und kosteten mehrere hundert Dollar. 1984 führte Borland Turbo Pascal ein, das für weniger als 100 Dollar verkauft wurde, eine Größenordnung schneller kompilierte als bestehende Compiler und mit einer Fülle von Quellcode und Hilfsprogrammen ausgestattet war.<br />
<br />
Dieses Produkt war ein großer Erfolg und war fast ein Jahrzehnt lang bekannt. Aber in den 1990er Jahren wurde die Welt auf Windows umgestellt. 1993 erschien die letzte Version von Turbo Pascal, Version 7 für DOS. Danach brach die Nachfrage nach DOS-Programmen ein und Borland (kurz Inprise genannt) konzentrierte sich auf die Produktion von Windows IDE/Compilern (z.B. Delphi). Später verkaufte Borland seine Compiler an Embarcadero, die Delphi immer noch regelmäßig aktualisieren.<br />
<br />
Dieses Tutorial behandelt nur die konsolenbasierte Programmierung, bei der der Computer Datenzeilen auf den Bildschirm druckt und der Benutzer über eine Tastatur mit dem Programm interagiert. Ziel des Tutorials ist es, das Programmieren in Pascal zu lehren. Sobald Sie das gelernt haben, können Sie sich einfach ein Nachschlagewerk oder eine andere Webseite anschauen und Grafiken und Fenstersysteme selbst in die Hand nehmen.<br />
<br />
Obwohl alte kommerzielle Pascal-Compiler oft zum Download zur Verfügung stehen (z.B. Turbo Pascal 5.5 aus dem [https://web.archive.org/web/20031206003232/http://bdn.borland.com/museum Borland Museum] und Symantec Think Pascal (Macintosh), siehe The Free Country's[http://www.thefreecountry.com/compilers/pascal.shtml Free Pascal Compiler List]), haben sich die Computer seit den 1980er und frühen 1990er Jahren stark weiterentwickelt. Wir haben keine 8.3-Dateinamen mehr unter DOS oder nicht präventives Multitasking unter Mac OS. Einen alten Compiler zu benutzen macht Spaß im gleichen Sinne wie ein altes Spiel auf einem Emulator zu spielen, aber die Open-Source-Bewegung hat gute Compiler für moderne Betriebssysteme hervorgebracht, und ein Anfänger wird es viel einfacher finden, diese zu benutzen.<br />
<br />
===Open Source Compiler===<br />
Die beiden wichtigsten Open-Source-Compiler-Projekte sind:<br />
* [http://www.gnu-pascal.de GNU Pascal]<br />
* [http://www.freepascal.org Free Pascal]<br />
<br />
Free Pascal wird allgemein als freundlicher für Anfänger angesehen und strebt danach, Borland Pascal in vielerlei Hinsicht zu emulieren, obwohl beide zum Erlernen von Pascal gut geeignet sind.<br />
<br />
Da die meisten Benutzer dieses Tutorials mit Windows arbeiten werden, hier ist, wie Sie Free Pascal einrichten und zu dem Punkt kommen, an dem Sie ein Programm auf einem modernen Windows-Betriebssystem kompilieren:<br />
<br />
# Lade den Win32 installer für Free Pascal unter [http://www.freepascal.org/download.var Free Pascal Download-Seite] herunter.<br />
# Führe die soeben heruntergeladene Datei aus und folge den Assistenten, um Free Pascal einzurichten.<br />
# Öffne Free Pascal über die Verknüpfung (befindet es sich standardmäßig in Start -> Free Pascal.<br />
# Gebe einen Programmcode ein (springe zur [[Hello%2C_World/de|nächsten Lektion]] um ein "Hello, world." Programm zu sehen).<br />
# Speicher die Datei über File-Save As ...<br />
# Starte das Programm über das Menü Ausführen. Dadurch wird das Programm automatisch kompiliert, wenn Du Änderungen vorgenommen hast, und das Programm ausgeführt. Das Programm wird auch ohne Kompilierung ausgeführt, wenn Du seit der letzten Kompilierung keine Änderungen vorgenommen hast.<br />
<br />
Bei Programmen, die keine Benutzereingaben erwarten, wird das Programm auf einem schwarzen Bildschirm angezeigt. Aber das Programm ist im Handumdrehen fertig und Du kehrst zur IDE zurück, ohne die Ergebnisse deiner Arbeit zu sehen. Es gibt zwei Möglichkeiten, dies zu umgehen:<br />
<br />
* Wähle den "User Screen" aus dem Debug-Menü, um die Ergebnisse des Programms zu sehen.<br />
* Füge am Ende jedes Programms eine readln-Anweisung hinzu. Dadurch wartet das Programm darauf, dass der Benutzer die Eingabetaste drückt, bevor das Programm beendet wird und zur IDE zurückkehrt.<br />
[[Image:Userscreen.png]]<br />
<br />
Beachte, dass eine.exe-Datei in dem Verzeichnis erstellt wurde, in dem Du Dein Programm gespeichert hast. Dies ist die ausführbare Datei. Du kannst zur Eingabeaufforderung gehen, in das Verzeichnis wechseln und diese ausführbare Datei direkt ausführen. Du kannst es auch im Windows Explorer doppelklicken (und es blinkt immer noch schnell, wenn es ohne Benutzereingabe endet).<br />
<br />
=== See also ===<br />
* [[Control Pascal Tutorial]] - eine einfache Möglichkeit, ohne Installation zu beginnen<br />
* [[How to start]] - ein anderer Weg, um mit einer Installation zu beginnen<br />
<br />
{{TYNavigator|Pascal_History|Hello,_World}}</div>Wsmekalhttps://wiki.freepascal.org/index.php?title=Basic_Pascal_Tutorial/Compilers&diff=150521Basic Pascal Tutorial/Compilers2022-02-03T09:16:41Z<p>Wsmekal: Corrected link to Turbo Pascal 5.5 (web archive)</p>
<hr />
<div>{{Compilers_ty}}<br />
{{TYNavigator|Pascal_History|Hello,_World}}<br />
<br />
Pascal Compilers (author: Tao Yue, state: ''changed'')<br />
<br />
This document will explain the basics about compilers as well as provide links to well-known Pascal compilers and explain how to set up Free Pascal.<br />
<br />
===About Computer Languages and Compilers===<br />
When talking about computer languages, there are basically three major terms that will be used.<br />
<br />
# '''Machine language''' -- actual binary code that gives basic instructions to the computer's CPU. These are usually very simple commands like adding two numbers or moving data from one memory location to another. For example, on x86, <code>add eax, 5</code> becomes <code>0x83, 0xC0, 0x05</code>, while <code>mov ax,bx</code> becomes <code>66 89 d8</code>.<br />
# '''Assembly language''' -- a way for humans to program computers directly without memorizing strings of binary numbers. There is a one-to-one correspondence with machine code. For example, in Intel x86 machine language, ADD and MOV are mnemonics for the addition and move operations.<br />
# '''High-level language''' -- permits humans to write complex programs without going step-by step. High-level languages include Pascal, C, C++, FORTRAN, Java, Visual Basic, C#, Java, and many more. One command in a high-level language, like writing a string to a file, may translate to dozens or even hundreds of machine language instructions.<br />
<br />
Microprocessors can only run machine language programs directly. Assembly language programs are assembled, or translated into machine language. Likewise, programs written in high-level languages, like Pascal, must also be translated into machine language before they can be run. To do this translation is to compile a program.<br />
<br />
The program that accomplishes the translation is called a '''compiler'''. This program is rather complex since it not only creates machine language instructions from lines of code, but often also optimizes the code to run faster, adds error-correction code, and links the code with subroutines stored elsewhere. For example, when you tell the computer to print something to the screen, the compiler translates this as a call to a pre-written module. Your code must then be linked to the code that the compiler manufacturer provides before an executable program results.<br />
<br />
With high-level languages, there are again three basic terms to remember:<br />
<br />
# Source code -- the code that you write. This typically has an extension that indicates the language used. For example, Pascal source code usually ends in "<tt>.pas</tt>" and C++ code usually ends in "<tt>.cpp</tt>"<br />
# Object code -- the result of compiling. Object code usually includes only one module of a program, and cannot be run yet since it is incomplete. On DOS/Windows systems, this usually has an extension of "<tt>.obj</tt>"<br />
# Executable code -- the end result. All the object code modules necessary for a program to function are linked together. On DOS/Windows systems, this usually has an extension of "<tt>.exe</tt>"<br />
<br />
===More About Compilers===<br />
The de facto standard in DOS and Windows-based Pascal compilers is Borland Pascal. Before it came out, most Pascal compilers were clumsy and slow, strayed from the Pascal standard, and cost several hundred dollars. In 1984, Borland introduced Turbo Pascal, which sold for less than $100, compiled an order of magnitude faster than existing compilers, and came with an abundance of source code and utility programs.<br />
<br />
This product was a great success and was prominent for almost a decade. But in the 1990s, the world was moving to Windows. In 1993, the last version of Turbo Pascal, version 7 for DOS, came out. After that, the demand for DOS programs plummeted and Borland (briefly known as Inprise) focused on producing Windows IDE/compilers (e.g. Delphi). Later, Borland sold its compilers to Embarcadero, who still regularly update Delphi.<br />
<br />
This tutorial will only deal with console-based programming, where the computer prints lines of data to the screen and the user interacts with the program using a keyboard. The goal of the tutorial is to teach how to program in Pascal. Once you've learned that, you can easily look at a reference book or another web page and pick up graphics and windowing systems on your own.<br />
<br />
Although old commercial Pascal compilers are often available for download (e.g. Turbo Pascal 5.5 from the [https://web.archive.org/web/20031206003232/http://bdn.borland.com/museum Borland Museum] and Symantec Think Pascal (Macintosh), see The Free Country's [http://www.thefreecountry.com/compilers/pascal.shtml Free Pascal Compiler List]), computers have progressed much since the 1980s and early 1990s. We are no longer stuck with 8.3 filenames on DOS or non-preemptive multitasking on Mac OS. Using an old compiler is fun in the same sense as playing an old game on an emulator is fun, but the open source movement has produced good compilers for modern operating systems, and a beginner will find it much easier to use those.<br />
<br />
===Open Source Compilers===<br />
The two main open-source compiler projects are:<br />
* [http://www.gnu-pascal.de GNU Pascal]<br />
* [https://www.freepascal.org Free Pascal]<br />
<br />
Free Pascal is generally considered friendlier for novices, and strives to emulate Borland Pascal in many ways, though both will serve fine for learning Pascal.<br />
<br />
As most users of this tutorial will be running Windows, here's how to set up Free Pascal and get to the point where you're compiling a program on a modern Windows operating system:<br />
<br />
# Download the Win32 installer for Free Pascal from the [https://www.freepascal.org/download.html Free Pascal download page].<br />
# Run the file you just downloaded and go through the wizard to setup Free Pascal.<br />
# Open Free Pascal using the shortcut (by default it is located in Start -> Free Pascal.<br />
# Type in a program (flip to the [[Hello%2C_World|next lesson]] to get a "Hello, world." program).<br />
# Save the file with File-Save As ...<br />
# Run the program from the Run menu. This will automatically compile the program if you've made any changes, then run the program. It will also run the program without compiling if you've not made any changes since the last time you compiled.<br />
<br />
With programs that don't expect user input, you'll see the program flash on a black screen. But the program completes in the blink of an eye and you are returned to the IDE without seeing the results of your work. There are two ways around this:<br />
<br />
* Select User screen from the Debug menu to see the results of the program.<br />
* Add a readln statement at the end of every program. This will make the program wait for the user to press the Enter key before the program ends and returns to the IDE.<br />
[[Image:Userscreen.png]]<br />
<br />
Note that an .exe file was created in the directory where you saved your program. This is the executable. You can go to the Command Prompt, change to the directory, and run this executable straight. You can also double-click on it in Windows Explorer (and it will still flash by quickly if it ends without requiring user input).<br />
<br />
=== See also ===<br />
* [[Control Pascal Tutorial]] - a simple way to start with no installation needed<br />
* [[How to start]] - another way to start with an installation<br />
<br />
{{TYNavigator|Pascal_History|Hello,_World}}</div>Wsmekalhttps://wiki.freepascal.org/index.php?title=Basic_Pascal_Tutorial/Compilers&diff=150520Basic Pascal Tutorial/Compilers2022-02-03T07:20:06Z<p>Wsmekal: Correct download link.</p>
<hr />
<div>{{Compilers_ty}}<br />
{{TYNavigator|Pascal_History|Hello,_World}}<br />
<br />
Pascal Compilers (author: Tao Yue, state: ''changed'')<br />
<br />
This document will explain the basics about compilers as well as provide links to well-known Pascal compilers and explain how to set up Free Pascal.<br />
<br />
===About Computer Languages and Compilers===<br />
When talking about computer languages, there are basically three major terms that will be used.<br />
<br />
# '''Machine language''' -- actual binary code that gives basic instructions to the computer's CPU. These are usually very simple commands like adding two numbers or moving data from one memory location to another. For example, on x86, <code>add eax, 5</code> becomes <code>0x83, 0xC0, 0x05</code>, while <code>mov ax,bx</code> becomes <code>66 89 d8</code>.<br />
# '''Assembly language''' -- a way for humans to program computers directly without memorizing strings of binary numbers. There is a one-to-one correspondence with machine code. For example, in Intel x86 machine language, ADD and MOV are mnemonics for the addition and move operations.<br />
# '''High-level language''' -- permits humans to write complex programs without going step-by step. High-level languages include Pascal, C, C++, FORTRAN, Java, Visual Basic, C#, Java, and many more. One command in a high-level language, like writing a string to a file, may translate to dozens or even hundreds of machine language instructions.<br />
<br />
Microprocessors can only run machine language programs directly. Assembly language programs are assembled, or translated into machine language. Likewise, programs written in high-level languages, like Pascal, must also be translated into machine language before they can be run. To do this translation is to compile a program.<br />
<br />
The program that accomplishes the translation is called a '''compiler'''. This program is rather complex since it not only creates machine language instructions from lines of code, but often also optimizes the code to run faster, adds error-correction code, and links the code with subroutines stored elsewhere. For example, when you tell the computer to print something to the screen, the compiler translates this as a call to a pre-written module. Your code must then be linked to the code that the compiler manufacturer provides before an executable program results.<br />
<br />
With high-level languages, there are again three basic terms to remember:<br />
<br />
# Source code -- the code that you write. This typically has an extension that indicates the language used. For example, Pascal source code usually ends in "<tt>.pas</tt>" and C++ code usually ends in "<tt>.cpp</tt>"<br />
# Object code -- the result of compiling. Object code usually includes only one module of a program, and cannot be run yet since it is incomplete. On DOS/Windows systems, this usually has an extension of "<tt>.obj</tt>"<br />
# Executable code -- the end result. All the object code modules necessary for a program to function are linked together. On DOS/Windows systems, this usually has an extension of "<tt>.exe</tt>"<br />
<br />
===More About Compilers===<br />
The de facto standard in DOS and Windows-based Pascal compilers is Borland Pascal. Before it came out, most Pascal compilers were clumsy and slow, strayed from the Pascal standard, and cost several hundred dollars. In 1984, Borland introduced Turbo Pascal, which sold for less than $100, compiled an order of magnitude faster than existing compilers, and came with an abundance of source code and utility programs.<br />
<br />
This product was a great success and was prominent for almost a decade. But in the 1990s, the world was moving to Windows. In 1993, the last version of Turbo Pascal, version 7 for DOS, came out. After that, the demand for DOS programs plummeted and Borland (briefly known as Inprise) focused on producing Windows IDE/compilers (e.g. Delphi). Later, Borland sold its compilers to Embarcadero, who still regularly update Delphi.<br />
<br />
This tutorial will only deal with console-based programming, where the computer prints lines of data to the screen and the user interacts with the program using a keyboard. The goal of the tutorial is to teach how to program in Pascal. Once you've learned that, you can easily look at a reference book or another web page and pick up graphics and windowing systems on your own.<br />
<br />
Although old commercial Pascal compilers are often available for download (e.g. Turbo Pascal 5.5 from the [http://dn.codegear.com/museum/ Borland Museum] and Symantec Think Pascal (Macintosh), see The Free Country's [http://www.thefreecountry.com/compilers/pascal.shtml Free Pascal Compiler List]), computers have progressed much since the 1980s and early 1990s. We are no longer stuck with 8.3 filenames on DOS or non-preemptive multitasking on Mac OS. Using an old compiler is fun in the same sense as playing an old game on an emulator is fun, but the open source movement has produced good compilers for modern operating systems, and a beginner will find it much easier to use those.<br />
<br />
===Open Source Compilers===<br />
The two main open-source compiler projects are:<br />
* [http://www.gnu-pascal.de GNU Pascal]<br />
* [https://www.freepascal.org Free Pascal]<br />
<br />
Free Pascal is generally considered friendlier for novices, and strives to emulate Borland Pascal in many ways, though both will serve fine for learning Pascal.<br />
<br />
As most users of this tutorial will be running Windows, here's how to set up Free Pascal and get to the point where you're compiling a program on a modern Windows operating system:<br />
<br />
# Download the Win32 installer for Free Pascal from the [https://www.freepascal.org/download.html Free Pascal download page].<br />
# Run the file you just downloaded and go through the wizard to setup Free Pascal.<br />
# Open Free Pascal using the shortcut (by default it is located in Start -> Free Pascal.<br />
# Type in a program (flip to the [[Hello%2C_World|next lesson]] to get a "Hello, world." program).<br />
# Save the file with File-Save As ...<br />
# Run the program from the Run menu. This will automatically compile the program if you've made any changes, then run the program. It will also run the program without compiling if you've not made any changes since the last time you compiled.<br />
<br />
With programs that don't expect user input, you'll see the program flash on a black screen. But the program completes in the blink of an eye and you are returned to the IDE without seeing the results of your work. There are two ways around this:<br />
<br />
* Select User screen from the Debug menu to see the results of the program.<br />
* Add a readln statement at the end of every program. This will make the program wait for the user to press the Enter key before the program ends and returns to the IDE.<br />
[[Image:Userscreen.png]]<br />
<br />
Note that an .exe file was created in the directory where you saved your program. This is the executable. You can go to the Command Prompt, change to the directory, and run this executable straight. You can also double-click on it in Windows Explorer (and it will still flash by quickly if it ends without requiring user input).<br />
<br />
=== See also ===<br />
* [[Control Pascal Tutorial]] - a simple way to start with no installation needed<br />
* [[How to start]] - another way to start with an installation<br />
<br />
{{TYNavigator|Pascal_History|Hello,_World}}</div>Wsmekalhttps://wiki.freepascal.org/index.php?title=Basic_Pascal_Tutorial/Compilers&diff=150519Basic Pascal Tutorial/Compilers2022-02-03T07:18:51Z<p>Wsmekal: https needed</p>
<hr />
<div>{{Compilers_ty}}<br />
{{TYNavigator|Pascal_History|Hello,_World}}<br />
<br />
Pascal Compilers (author: Tao Yue, state: ''changed'')<br />
<br />
This document will explain the basics about compilers as well as provide links to well-known Pascal compilers and explain how to set up Free Pascal.<br />
<br />
===About Computer Languages and Compilers===<br />
When talking about computer languages, there are basically three major terms that will be used.<br />
<br />
# '''Machine language''' -- actual binary code that gives basic instructions to the computer's CPU. These are usually very simple commands like adding two numbers or moving data from one memory location to another. For example, on x86, <code>add eax, 5</code> becomes <code>0x83, 0xC0, 0x05</code>, while <code>mov ax,bx</code> becomes <code>66 89 d8</code>.<br />
# '''Assembly language''' -- a way for humans to program computers directly without memorizing strings of binary numbers. There is a one-to-one correspondence with machine code. For example, in Intel x86 machine language, ADD and MOV are mnemonics for the addition and move operations.<br />
# '''High-level language''' -- permits humans to write complex programs without going step-by step. High-level languages include Pascal, C, C++, FORTRAN, Java, Visual Basic, C#, Java, and many more. One command in a high-level language, like writing a string to a file, may translate to dozens or even hundreds of machine language instructions.<br />
<br />
Microprocessors can only run machine language programs directly. Assembly language programs are assembled, or translated into machine language. Likewise, programs written in high-level languages, like Pascal, must also be translated into machine language before they can be run. To do this translation is to compile a program.<br />
<br />
The program that accomplishes the translation is called a '''compiler'''. This program is rather complex since it not only creates machine language instructions from lines of code, but often also optimizes the code to run faster, adds error-correction code, and links the code with subroutines stored elsewhere. For example, when you tell the computer to print something to the screen, the compiler translates this as a call to a pre-written module. Your code must then be linked to the code that the compiler manufacturer provides before an executable program results.<br />
<br />
With high-level languages, there are again three basic terms to remember:<br />
<br />
# Source code -- the code that you write. This typically has an extension that indicates the language used. For example, Pascal source code usually ends in "<tt>.pas</tt>" and C++ code usually ends in "<tt>.cpp</tt>"<br />
# Object code -- the result of compiling. Object code usually includes only one module of a program, and cannot be run yet since it is incomplete. On DOS/Windows systems, this usually has an extension of "<tt>.obj</tt>"<br />
# Executable code -- the end result. All the object code modules necessary for a program to function are linked together. On DOS/Windows systems, this usually has an extension of "<tt>.exe</tt>"<br />
<br />
===More About Compilers===<br />
The de facto standard in DOS and Windows-based Pascal compilers is Borland Pascal. Before it came out, most Pascal compilers were clumsy and slow, strayed from the Pascal standard, and cost several hundred dollars. In 1984, Borland introduced Turbo Pascal, which sold for less than $100, compiled an order of magnitude faster than existing compilers, and came with an abundance of source code and utility programs.<br />
<br />
This product was a great success and was prominent for almost a decade. But in the 1990s, the world was moving to Windows. In 1993, the last version of Turbo Pascal, version 7 for DOS, came out. After that, the demand for DOS programs plummeted and Borland (briefly known as Inprise) focused on producing Windows IDE/compilers (e.g. Delphi). Later, Borland sold its compilers to Embarcadero, who still regularly update Delphi.<br />
<br />
This tutorial will only deal with console-based programming, where the computer prints lines of data to the screen and the user interacts with the program using a keyboard. The goal of the tutorial is to teach how to program in Pascal. Once you've learned that, you can easily look at a reference book or another web page and pick up graphics and windowing systems on your own.<br />
<br />
Although old commercial Pascal compilers are often available for download (e.g. Turbo Pascal 5.5 from the [http://dn.codegear.com/museum/ Borland Museum] and Symantec Think Pascal (Macintosh), see The Free Country's [http://www.thefreecountry.com/compilers/pascal.shtml Free Pascal Compiler List]), computers have progressed much since the 1980s and early 1990s. We are no longer stuck with 8.3 filenames on DOS or non-preemptive multitasking on Mac OS. Using an old compiler is fun in the same sense as playing an old game on an emulator is fun, but the open source movement has produced good compilers for modern operating systems, and a beginner will find it much easier to use those.<br />
<br />
===Open Source Compilers===<br />
The two main open-source compiler projects are:<br />
* [http://www.gnu-pascal.de GNU Pascal]<br />
* [https://www.freepascal.org Free Pascal]<br />
<br />
Free Pascal is generally considered friendlier for novices, and strives to emulate Borland Pascal in many ways, though both will serve fine for learning Pascal.<br />
<br />
As most users of this tutorial will be running Windows, here's how to set up Free Pascal and get to the point where you're compiling a program on a modern Windows operating system:<br />
<br />
# Download the Win32 installer for Free Pascal from the [http://www.freepascal.org/download.var Free Pascal download page].<br />
# Run the file you just downloaded and go through the wizard to setup Free Pascal.<br />
# Open Free Pascal using the shortcut (by default it is located in Start -> Free Pascal.<br />
# Type in a program (flip to the [[Hello%2C_World|next lesson]] to get a "Hello, world." program).<br />
# Save the file with File-Save As ...<br />
# Run the program from the Run menu. This will automatically compile the program if you've made any changes, then run the program. It will also run the program without compiling if you've not made any changes since the last time you compiled.<br />
<br />
With programs that don't expect user input, you'll see the program flash on a black screen. But the program completes in the blink of an eye and you are returned to the IDE without seeing the results of your work. There are two ways around this:<br />
<br />
* Select User screen from the Debug menu to see the results of the program.<br />
* Add a readln statement at the end of every program. This will make the program wait for the user to press the Enter key before the program ends and returns to the IDE.<br />
[[Image:Userscreen.png]]<br />
<br />
Note that an .exe file was created in the directory where you saved your program. This is the executable. You can go to the Command Prompt, change to the directory, and run this executable straight. You can also double-click on it in Windows Explorer (and it will still flash by quickly if it ends without requiring user input).<br />
<br />
=== See also ===<br />
* [[Control Pascal Tutorial]] - a simple way to start with no installation needed<br />
* [[How to start]] - another way to start with an installation<br />
<br />
{{TYNavigator|Pascal_History|Hello,_World}}</div>Wsmekal