Autor Beitrag
Calculon
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 676

Win XP Professional
Delphi 7 PE, Delphi 3 PRO
BeitragVerfasst: Fr 13.10.06 22:54 
Hallo allerseits,
weiß jemand, wie man bei einer Konsolenanwendung verhindern kann, dass sie sich nach der Ausführung der Befehle automatisch schließt?
Ich denke da an so etwas wie: "Press any key to close window".
Gruß
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Fr 13.10.06 22:57 
ausblenden Delphi-Quelltext
1:
2:
writeline('Press any key to close window');
readln;


Das leere Readline sorgt dafür, dass das Fenster solange offenbleibt, bist der Benutzer eine Taste drückt ;)
Calculon Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 676

Win XP Professional
Delphi 7 PE, Delphi 3 PRO
BeitragVerfasst: Fr 13.10.06 23:30 
Funktioniert! Danke!
Nur "writeline" mag meine Delphi-Version nicht. Da muss es "writeln" heißen.
Und ich muss meinen Text in "Press Enter to close window" umbenennen. Aber das reicht mir völlig!
Gruß
Calculon Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 676

Win XP Professional
Delphi 7 PE, Delphi 3 PRO
BeitragVerfasst: Mi 25.10.06 08:15 
Kurzer Nachtrag:
Habe jetzt die unit crt32.pas eingebunden und dort gibt es dir procedure keypressed. Mit ihr ist es möglich die Aktion "Press any key to exit" auszuführen".
Gruß