mirror of
https://github.com/moparisthebest/Simba
synced 2025-02-25 07:51:46 -05:00

Windows users now have the option to use a console or not (it's the little CMD-image-button). Non-important information will still be written to the console (so you must open it if you want some lil extra information). Now default compiles *without* the -WG switch, otherwise you LCL will raise exceptions when the Console is closed Added some exceptions to the Files unit, rather than returning -1. Use mDebug to write something to the terminal (it's inside the MufasaBase unit). git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@581 3f818213-9676-44b0-a9b4-5e4c4e03d09d
51 lines
791 B
ObjectPascal
51 lines
791 B
ObjectPascal
unit mufasabase;
|
|
|
|
{$mode objfpc}
|
|
|
|
interface
|
|
|
|
uses
|
|
files, Classes, SysUtils{$ifdef MSWindows},windows{$endif};
|
|
|
|
procedure mDebugLn( s : string);overload;
|
|
procedure mDebugLn( s : string; f : array of const);overload;
|
|
procedure InitmDebug;
|
|
procedure FreemDebug;
|
|
implementation
|
|
|
|
uses
|
|
TestUnit;
|
|
var
|
|
CanDebug : boolean = false;
|
|
|
|
procedure mDebugLn(s: string);
|
|
begin
|
|
if CanDebug then
|
|
Writeln(s);
|
|
end;
|
|
|
|
procedure mDebugLn(s: string; f: array of const); overload;
|
|
begin
|
|
mDebugLn(format(s,f));
|
|
end;
|
|
|
|
procedure InitmDebug;
|
|
begin
|
|
CanDebug := true;
|
|
{$ifdef MSWindows}
|
|
IsConsole:= True;
|
|
SysInitStdIO;
|
|
{$endif}
|
|
end;
|
|
|
|
procedure FreemDebug;
|
|
begin
|
|
CanDebug := false;
|
|
{$ifdef MSWindows}
|
|
IsConsole := false;
|
|
{$endif}
|
|
end;
|
|
|
|
end.
|
|
|