mirror of
https://github.com/vapaamies/KolibriOS.git
synced 2025-09-23 23:53:50 +02:00
CRT unit with colored console example added
This commit is contained in:
34
Examples/Console/DateTime/DateTime.dpr
Normal file
34
Examples/Console/DateTime/DateTime.dpr
Normal file
@@ -0,0 +1,34 @@
|
||||
program DateTime;
|
||||
|
||||
uses
|
||||
KolibriOS, CRT;
|
||||
|
||||
var
|
||||
SystemDate: TSystemDate;
|
||||
SystemTime: TSystemTime;
|
||||
CursorPos: TConsolePoint;
|
||||
|
||||
begin
|
||||
ConsoleInit('Date/Time');
|
||||
|
||||
SetCursorHeight(0);
|
||||
SetCursorPos(27, 11);
|
||||
Write(
|
||||
'System Date and System Time'#10 +
|
||||
' '
|
||||
);
|
||||
CursorPos := GetCursorPos;
|
||||
repeat
|
||||
SystemDate := GetSystemDate;
|
||||
SystemTime := GetSystemTime;
|
||||
with SystemDate, SystemTime do
|
||||
begin
|
||||
Write('%02x.%02x.%02x', Day, Month, Year);
|
||||
Write(' - %02x:%02x:%02x', Hours, Minutes, Seconds);
|
||||
end;
|
||||
SetCursorPos(CursorPos);
|
||||
Sleep(50);
|
||||
until KeyPressed;
|
||||
|
||||
ConsoleExit(True);
|
||||
end.
|
Reference in New Issue
Block a user