mirror of
https://github.com/vapaamies/KolibriOS.git
synced 2025-09-22 07:03:53 +02:00
Example projects renamed, simplified and formatted to the Borland/Embarcadero style
This commit is contained in:
28
KolibriOS/Examples/LoadFile/LoadFile.dpr
Normal file
28
KolibriOS/Examples/LoadFile/LoadFile.dpr
Normal file
@@ -0,0 +1,28 @@
|
||||
program LoadFileApp;
|
||||
|
||||
uses
|
||||
KolibriOS;
|
||||
|
||||
var
|
||||
hConsole: Pointer;
|
||||
ConsoleInit: procedure(WndWidth, WndHeight, ScrWidth, ScrHeight: LongWord; Caption: PChar); stdcall;
|
||||
ConsoleExit: procedure(bCloseWindow: Cardinal); stdcall;
|
||||
WriteN: procedure(Str: PChar; Count: LongWord); stdcall;
|
||||
|
||||
FileSize: LongWord;
|
||||
Buffer: Pointer;
|
||||
|
||||
begin
|
||||
hConsole := LoadLibrary('/sys/lib/console.obj');
|
||||
ConsoleInit := GetProcAddress(hConsole, 'con_init');
|
||||
ConsoleExit := GetProcAddress(hConsole, 'con_exit');
|
||||
WriteN := GetProcAddress(hConsole, 'con_write_string');
|
||||
|
||||
ConsoleInit($FFFFFFFF, $FFFFFFFF, $FFFFFFFF, $FFFFFFFF, 'Test');
|
||||
|
||||
Buffer := LoadFile('/sys/example.asm', FileSize);
|
||||
WriteN(Buffer, FileSize);
|
||||
|
||||
ConsoleExit(0);
|
||||
TerminateThread;
|
||||
end.
|
1
KolibriOS/Examples/LoadFile/make.bat
Normal file
1
KolibriOS/Examples/LoadFile/make.bat
Normal file
@@ -0,0 +1 @@
|
||||
../make.bat Unit1
|
Reference in New Issue
Block a user