mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-14 19:07:09 +03:00
65c332bd36
git-svn-id: svn://kolibrios.org@7983 a494cfbc-eb01-0410-851d-a64ba20cac60
82 lines
1.0 KiB
Plaintext
82 lines
1.0 KiB
Plaintext
(*
|
|
BSD 2-Clause License
|
|
|
|
Copyright (c) 2018-2019, Anton Krotov
|
|
All rights reserved.
|
|
*)
|
|
|
|
MODULE CONSOLE;
|
|
|
|
IMPORT UTILS, STRINGS;
|
|
|
|
|
|
PROCEDURE String* (s: ARRAY OF CHAR);
|
|
VAR
|
|
i: INTEGER;
|
|
|
|
BEGIN
|
|
i := 0;
|
|
WHILE (i < LEN(s)) & (s[i] # 0X) DO
|
|
UTILS.OutChar(s[i]);
|
|
INC(i)
|
|
END
|
|
END String;
|
|
|
|
|
|
PROCEDURE Int* (x: INTEGER);
|
|
VAR
|
|
s: ARRAY 24 OF CHAR;
|
|
|
|
BEGIN
|
|
STRINGS.IntToStr(x, s);
|
|
String(s)
|
|
END Int;
|
|
|
|
|
|
PROCEDURE Hex* (x, n: INTEGER);
|
|
VAR
|
|
s: ARRAY 24 OF CHAR;
|
|
|
|
BEGIN
|
|
STRINGS.IntToHex(x, s, n);
|
|
String(s)
|
|
END Hex;
|
|
|
|
|
|
PROCEDURE Int2* (x: INTEGER);
|
|
BEGIN
|
|
IF x < 10 THEN
|
|
String("0")
|
|
END;
|
|
Int(x)
|
|
END Int2;
|
|
|
|
|
|
PROCEDURE Ln*;
|
|
BEGIN
|
|
String(UTILS.eol)
|
|
END Ln;
|
|
|
|
|
|
PROCEDURE StringLn* (s: ARRAY OF CHAR);
|
|
BEGIN
|
|
String(s);
|
|
Ln
|
|
END StringLn;
|
|
|
|
|
|
PROCEDURE IntLn* (x: INTEGER);
|
|
BEGIN
|
|
Int(x);
|
|
Ln
|
|
END IntLn;
|
|
|
|
|
|
PROCEDURE Int2Ln* (x: INTEGER);
|
|
BEGIN
|
|
Int2(x);
|
|
Ln
|
|
END Int2Ln;
|
|
|
|
|
|
END CONSOLE. |