Sign in Join
Wiki copytemporary

write to the console/de: what changed

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

Title: write to the console/de

OldNewLine
1+Zurück zur [[Console/de|Konsolenseite]].
2+
3+# Ausgabe auf die Konsole
4+
5+Dieser Artikel dient der Konsolen- / Terminalprogrammierung unter Windows und Linux.
6+
7+Wenn 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.
8+
9+Zum Schreiben auf die Konsole / Terminal gibt es zwei Befehle:
10+
11+- Write
12+- WriteLn
13+
14+Der Unterschied zwischen den beiden Befehlen besteht darin, dass der Befehl *'Write*\# alle Ausgaben aneinander reiht.
15+
16+Der Befehl **WriteLn** macht nach jeder Ausgabe einen Zeilenumbruch.
17+
18+Wie kann man sich das Vorstellen?
19+
20+Beispiel für den Befehl **Write**:
21+
22+``` pascal
23+program Project1;
24+
25+{$mode objfpc}{$H+}
26+{$IMPLICITEXCEPTIONS OFF}
27+
28+var
29+ intI: Integer;
30+
31+begin
32+
33+ for intI := 1 to 10 do
34+ Write('Hallo Welt!');
35+
36+end.
37+```
38+
39+Das obige Beispiel ergibt eine Ausgabe, die wie folgt aussieht:
40+
41+Hallo Welt!Hallo Welt!Hallo Welt!Hallo Welt!Hallo Welt!Hallo Welt!Hallo Welt!Hal
42+
43+lo Welt!Hallo Welt!Hallo Welt!
44+
45+Beispiel für den Befehl **WriteLn**:
46+
47+``` pascal
48+program Project1;
49+
50+{$mode objfpc}{$H+}
51+{$IMPLICITEXCEPTIONS OFF}
52+
53+var
54+ intI: Integer;
55+
56+begin
57+
58+ for intI := 1 to 10 do
59+ WriteLn('Hallo Welt!');
60+
61+end.
62+```
63+
64+Das obige Beispiel ergibt eine Ausgabe, die wie folgt aussieht:
65+
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!`
76+
77+---
78+*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