diff options
author | jaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-03-26 12:03:20 +0000 |
---|---|---|
committer | jaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-03-26 12:03:20 +0000 |
commit | bbf6784e26b5f94c87c9deedb75711948d937f46 (patch) | |
tree | 61c758183bf12ee20677e21912c69e572bf00bd5 /Game/Code/Classes/UDataBase.pas | |
parent | 7968b0878c1c13f61dddbacb603e00997af38f63 (diff) | |
download | usdx-bbf6784e26b5f94c87c9deedb75711948d937f46.tar.gz usdx-bbf6784e26b5f94c87c9deedb75711948d937f46.tar.xz usdx-bbf6784e26b5f94c87c9deedb75711948d937f46.zip |
added "-debug" flag at run time and "CONSOLE" Define in switches.inc
also the default is to run with no debug info sent to the console
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@973 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Classes/UDataBase.pas')
-rw-r--r-- | Game/Code/Classes/UDataBase.pas | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Game/Code/Classes/UDataBase.pas b/Game/Code/Classes/UDataBase.pas index ef3c28fe..dcf32315 100644 --- a/Game/Code/Classes/UDataBase.pas +++ b/Game/Code/Classes/UDataBase.pas @@ -62,7 +62,10 @@ var implementation -uses IniFiles, SysUtils; +uses + IniFiles, + ULog, + SysUtils; const cUS_Scores = 'us_scores'; @@ -74,7 +77,7 @@ const Procedure TDataBaseSystem.Init(const Filename: string); begin - writeln( 'TDataBaseSystem.Init ('+Filename+') @ '+ floattostr( now() ) ); + debugWriteln( 'TDataBaseSystem.Init ('+Filename+') @ '+ floattostr( now() ) ); //Open Database ScoreDB := TSqliteDatabase.Create( Filename ); @@ -85,13 +88,13 @@ begin if not ScoreDB.TableExists( cUS_Scores ) then begin ScoreDB.execsql('CREATE TABLE `'+cUS_Scores+'` (`SongID` INT( 11 ) NOT NULL , `Difficulty` INT( 1 ) NOT NULL , `Player` VARCHAR( 150 ) NOT NULL , `Score` INT( 5 ) NOT NULL );'); - writeln( 'TDataBaseSystem.Init - CREATED US_Scores' ); + debugWriteln( 'TDataBaseSystem.Init - CREATED US_Scores' ); end; if not ScoreDB.TableExists( cUS_Songs ) then begin ScoreDB.execsql('CREATE TABLE `'+cUS_Songs+'` (`ID` INTEGER PRIMARY KEY, `Artist` VARCHAR( 255 ) NOT NULL , `Title` VARCHAR( 255 ) NOT NULL , `TimesPlayed` int(5) NOT NULL );'); - writeln( 'TDataBaseSystem.Init - CREATED US_Songs' ); + debugWriteln( 'TDataBaseSystem.Init - CREATED US_Songs' ); end; //Not possible because of String Limitation to 255 Chars //Need to rewrite Wrapper @@ -100,8 +103,8 @@ begin finally - writeln( cUS_Songs +' Exist : ' + inttostr( integer(ScoreDB.TableExists( cUS_Songs )) ) ); - writeln( cUS_Scores +' Exist : ' + inttostr( integer(ScoreDB.TableExists( cUS_Scores )) ) ); + debugWriteln( cUS_Songs +' Exist : ' + inttostr( integer(ScoreDB.TableExists( cUS_Songs )) ) ); + debugWriteln( cUS_Scores +' Exist : ' + inttostr( integer(ScoreDB.TableExists( cUS_Scores )) ) ); //ScoreDB.Free; end; @@ -112,7 +115,7 @@ end; //-------------------- Destructor TDataBaseSystem.Free; begin - writeln( 'TDataBaseSystem.Free' ); + debugWriteln( 'TDataBaseSystem.Free' ); freeandnil( ScoreDB ); end; |