3,7 → 3,7 |
(************************************************) |
(* VTSCUI.PAS *) |
(* Author: Daniel Marschall *) |
(* Revision: 2022-02-16 *) |
(* Revision: 2022-02-19 *) |
(* License: Apache 2.0 *) |
(* This file contains: *) |
(* - ViaThinkSoft CUI (Console User Interface) *) |
37,6 → 37,7 |
procedure CursorOn; |
procedure CursorOff; |
procedure ResetDefaultDosColors; |
procedure WriteLnKeepX(s: string); |
|
implementation |
|
603,4 → 604,25 |
TextColor(LightGray); |
end; |
|
procedure WriteLnKeepX(s: string); |
var |
i: integer; |
initX: integer; |
bytesToWrite: integer; |
pNewLine: integer; |
begin |
initX := WhereX; |
while Length(s) > 0 do |
begin |
pNewLine := Pos(#13#10, s); |
GoToXy(initX, WhereY); |
bytesToWrite := ScreenWidth - initX + 1; |
if (pNewLine > 0) and (pNewLine < bytesToWrite) then |
bytesToWrite := pNewLine; |
Write(Copy(s, 1, bytesToWrite)); (* No WriteLn because there is automatic scrolling *) |
Delete(s, 1, bytesToWrite); |
end; |
WriteLn(''); |
end; |
|
end. |