Skip to content

Commit bf7beee

Browse files
committed
[console] optional clear line
1 parent e38ad29 commit bf7beee

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: Quick.Console.pas

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{ ***************************************************************************
22
3-
Copyright (c) 2016-2021 Kike Pérez
3+
Copyright (c) 2016-2024 Kike Pérez
44
55
Unit : Quick.Console
66
Description : Console output with colors and optional file log
77
Author : Kike Pérez
88
Version : 1.9
99
Created : 10/05/2017
10-
Modified : 05/08/2021
10+
Modified : 20/01/2024
1111
1212
This file is part of QuickLib: https://github.com/exilon/QuickLib
1313
@@ -172,7 +172,7 @@ TConsoleMenu = class
172172
procedure coutSL(const cMsg : string; cColor : TConsoleColor);
173173
procedure cout(const cMsg : string; params : array of const; cEventType : TLogEventType); overload;
174174
procedure coutXY(x,y : Integer; const cMsg : string; cEventType : TLogEventType); overload;
175-
procedure coutXY(x,y : Integer; const cMsg : string; cColor : TConsoleColor); overload;
175+
procedure coutXY(x,y : Integer; const cMsg : string; cColor : TConsoleColor; cClearLineBefore : Boolean = False); overload;
176176
procedure coutXY(x,y : Integer; const cMsg : string; params : array of const; cEventType : TLogEventType); overload;
177177
procedure coutXY(x,y : Integer; const cMsg : string; params : array of const; cColor : TConsoleColor); overload;
178178
procedure coutTL(const cMsg : string; cEventType : TLogEventType); overload;
@@ -480,7 +480,7 @@ procedure coutXY(x,y : Integer; const cMsg : string; cEventType : TLogEventType)
480480
end;
481481
end;
482482

483-
procedure coutXY(x,y : Integer; const cMsg : string; cColor : TConsoleColor); overload;
483+
procedure coutXY(x,y : Integer; const cMsg : string; cColor : TConsoleColor; cClearLineBefore : Boolean = False); overload;
484484
var
485485
NewCoord : TCoord;
486486
LastCoord : TCoord;
@@ -496,7 +496,7 @@ procedure coutXY(x,y : Integer; const cMsg : string; cColor : TConsoleColor); ov
496496
{$ENDIF}
497497
NewCoord.X := x;
498498
NewCoord.Y := y;
499-
ClearLine(Y);
499+
if cClearLineBefore then ClearLine(Y);
500500
SetCursorPos(NewCoord);
501501
try
502502
cout(cMsg,cColor);

0 commit comments

Comments
 (0)