82d72daa76
git-svn-id: svn://kolibrios.org@7597 a494cfbc-eb01-0410-851d-a64ba20cac60
72 lines
928 B
Plaintext
72 lines
928 B
Plaintext
(*
|
|
BSD 2-Clause License
|
|
|
|
Copyright (c) 2018, 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* (n: INTEGER);
|
|
VAR
|
|
s: ARRAY 32 OF CHAR;
|
|
|
|
BEGIN
|
|
STRINGS.IntToStr(n, s);
|
|
String(s)
|
|
END Int;
|
|
|
|
|
|
PROCEDURE Int2* (n: INTEGER);
|
|
BEGIN
|
|
IF n < 10 THEN
|
|
String("0")
|
|
END;
|
|
Int(n)
|
|
END Int2;
|
|
|
|
|
|
PROCEDURE Ln*;
|
|
BEGIN
|
|
String(UTILS.eol)
|
|
END Ln;
|
|
|
|
|
|
PROCEDURE StringLn* (s: ARRAY OF CHAR);
|
|
BEGIN
|
|
String(s);
|
|
Ln
|
|
END StringLn;
|
|
|
|
|
|
PROCEDURE IntLn* (n: INTEGER);
|
|
BEGIN
|
|
Int(n);
|
|
Ln
|
|
END IntLn;
|
|
|
|
|
|
PROCEDURE Int2Ln* (n: INTEGER);
|
|
BEGIN
|
|
Int2(n);
|
|
Ln
|
|
END Int2Ln;
|
|
|
|
|
|
END CONSOLE. |