Sign in Join
Wiki copytemporary

write to the console/de: what changed

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

OldNewLine
11Zurück zur [[Console/de|Konsolenseite]].
22
33# Ausgabe auf die Konsole
44
55Dieser Artikel dient der Konsolen- / Terminalprogrammierung unter Windows und Linux.
66
77Wenn Sie also eine Anwendung für Konsole / Terminal erstellen und Sie wollen, dass das Programm nicht nur still vor sich hin arbeitet, dann benötigt das Programm eine Ausgabe an der Konsole / Terminal.
88
99Zum Schreiben auf die Konsole / Terminal gibt es zwei Befehle:
1010
1111- Write
1212- WriteLn
1313
1414Der Unterschied zwischen den beiden Befehlen besteht darin, dass der Befehl *'Write*\# alle Ausgaben aneinander reiht.
1515
1616Der Befehl **WriteLn** macht nach jeder Ausgabe einen Zeilenumbruch.
1717
1818Wie kann man sich das Vorstellen?
1919
2020Beispiel für den Befehl **Write**:
2121
2222``` pascal
2323program Project1;
2424
2525{$mode objfpc}{$H+}
2626{$IMPLICITEXCEPTIONS OFF}
2727
2828var
2929 intI: Integer;
3030
3131begin
3232
3333 for intI := 1 to 10 do
3434 Write('Hallo Welt!');
3535
3636end.
3737```
3838
3939Das obige Beispiel ergibt eine Ausgabe, die wie folgt aussieht:
4040
4141Hallo Welt!Hallo Welt!Hallo Welt!Hallo Welt!Hallo Welt!Hallo Welt!Hallo Welt!Hal
4242
4343lo Welt!Hallo Welt!Hallo Welt!
4444
4545Beispiel für den Befehl **WriteLn**:
4646
4747``` pascal
4848program Project1;
4949
5050{$mode objfpc}{$H+}
5151{$IMPLICITEXCEPTIONS OFF}
5252
5353var
5454 intI: Integer;
5555
5656begin
5757
5858 for intI := 1 to 10 do
5959 WriteLn('Hallo Welt!');
6060
6161end.
6262```
6363
6464Das obige Beispiel ergibt eine Ausgabe, die wie folgt aussieht:
6565
66-`Hallo Welt!`\
67-`Hallo Welt!`\
68-`Hallo Welt!`\
69-`Hallo Welt!`\
70-`Hallo Welt!`\
71-`Hallo Welt!`\
72-`Hallo Welt!`\
73-`Hallo Welt!`\
74-`Hallo Welt!`\
75-`Hallo Welt!`
66+```text
67+Hallo Welt!
68+Hallo Welt!
69+Hallo Welt!
70+Hallo Welt!
71+Hallo Welt!
72+Hallo Welt!
73+Hallo Welt!
74+Hallo Welt!
75+Hallo Welt!
76+Hallo Welt!
77+```
7678
7779---
7880*From the Free Pascal wiki, page "write to the console/de", as it stood on 2020-03-04 after a change by Trev, 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