mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 12:49:20 +02:00
sinclairql: for setting the exit message of the default console, use a helper function instead.
git-svn-id: trunk@49365 -
This commit is contained in:
parent
6fbf4dfd90
commit
13f3cd2ae3
@ -84,6 +84,7 @@ function SetQLJobName(const s: string): longint;
|
|||||||
function GetQLJobName: string;
|
function GetQLJobName: string;
|
||||||
function GetQLJobNamePtr: pointer;
|
function GetQLJobNamePtr: pointer;
|
||||||
|
|
||||||
|
procedure SetQLDefaultConExitMessage(const msg: PChar);
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -275,10 +276,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
const
|
||||||
|
QLDefaultConExitMessage: PChar = 'Press any key to exit';
|
||||||
|
|
||||||
|
procedure SetQLDefaultConExitMessage(const msg: PChar);
|
||||||
|
begin
|
||||||
|
QLDefaultConExitMessage:=msg;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function QLOpenCon(var console: QLConHandle): boolean; weakexternal name 'QLOpenCon';
|
function QLOpenCon(var console: QLConHandle): boolean; weakexternal name 'QLOpenCon';
|
||||||
procedure QLCloseCon(var console: QLConHandle); weakexternal name 'QLCloseCon';
|
procedure QLCloseCon(var console: QLConHandle); weakexternal name 'QLCloseCon';
|
||||||
function QLDefaultConExitMessage: PChar; weakexternal name 'QLDefaultConExitMessage';
|
|
||||||
|
|
||||||
function DefaultQLOpenCon(var console: QLConHandle): boolean;
|
function DefaultQLOpenCon(var console: QLConHandle): boolean;
|
||||||
var
|
var
|
||||||
@ -307,21 +315,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure DefaultQLCloseCon(var console: QLConHandle);
|
procedure DefaultQLCloseCon(var console: QLConHandle);
|
||||||
const
|
|
||||||
anyKey: pchar = 'Press any key to exit';
|
|
||||||
var
|
|
||||||
msg: pchar;
|
|
||||||
begin
|
begin
|
||||||
with console do
|
with console do
|
||||||
begin
|
begin
|
||||||
if assigned(@QLDefaultConExitMessage) then
|
if assigned(QLDefaultConExitMessage) and (length(QLDefaultConExitMessage) > 0) then
|
||||||
msg:=QLDefaultConExitMessage
|
|
||||||
else
|
|
||||||
msg:=anyKey;
|
|
||||||
|
|
||||||
if assigned(msg) then
|
|
||||||
begin
|
begin
|
||||||
io_sstrg(outputHandle, -1, msg, length(msg));
|
io_sstrg(outputHandle, -1, QLDefaultConExitMessage, length(QLDefaultConExitMessage));
|
||||||
io_fbyte(inputHandle, -1);
|
io_fbyte(inputHandle, -1);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user