Units initialization/finalization support added

This commit is contained in:
2020-06-07 19:39:30 +03:00
parent 92d967d122
commit bf2e9bcc4b
9 changed files with 104 additions and 42 deletions

View File

@@ -4,7 +4,7 @@ uses
CRT;
begin
ConsoleInit('Console Colors');
InitConsole('Console Colors');
TextBackground(Black);
WriteLn('Black');
@@ -75,6 +75,4 @@ begin
WriteLn('White');
ReadKey;
ConsoleExit(True);
end.

View File

@@ -9,7 +9,7 @@ var
CursorPos: TConsolePoint;
begin
ConsoleInit('Date/Time');
InitConsole('Date/Time');
SetCursorHeight(0);
SetCursorPos(27, 11);
@@ -29,6 +29,4 @@ begin
SetCursorPos(CursorPos);
Sleep(50);
until KeyPressed;
ConsoleExit(True);
end.

View File

@@ -13,13 +13,11 @@ var
Buffer: array[0..BUFFER_SIZE - 1] of Char;
begin
ConsoleInit('Get Current Directory');
InitConsole('Get Current Directory', False);
GetCurrentDirectory(Buffer, BUFFER_SIZE);
Write('AppPath is "%s"'#10, AppPath^);
Write('CmdLine is "%s"'#10, CmdLine^);
Write('Current Directory is "%s"'#10, Buffer);
ConsoleExit(False);
end.

View File

@@ -4,10 +4,7 @@ uses
CRT;
begin
ConsoleInit('Hello');
InitConsole('Hello');
WriteLn('Hello, world!');
ReadKey;
ConsoleExit(True);
end.

View File

@@ -8,10 +8,8 @@ var
Buffer: Pointer;
begin
ConsoleInit('Load File');
InitConsole('Load File', False);
Buffer := LoadFile('/sys/example.asm', FileSize);
WriteText(Buffer, FileSize);
ConsoleExit(False);
end.

View File

@@ -17,7 +17,7 @@ var
Pos: LongWord;
begin
ConsoleInit('Read Folder');
InitConsole('Read Folder', False);
if ReadFolder(FolderPath, FolderInformation, 0, 0, 0, BlocksRead) = 0 then
with FolderInformation do
@@ -53,6 +53,4 @@ begin
Write(#10);
Inc(Pos);
end;
ConsoleExit(False);
end.