Page 1 of 1
Not printing in debug
Posted: Wed Mar 03, 2021 11:59 pm
by JaxMusic
Code: Select all
Sql.s ;SQL string For commands
DBName.s ;Database name
;Get row count
Sql="Select count(PersonName) As RowCount from Test_names"
DBName="Test.sqlite"
Debug DBName
Debug Sql
Honestly I do not get this. I assign some values to variable, both strings, both declared.
At first, neither of these Debug statements appeared in the debug window. Restarted the IDE, the DBName would show up but the Sql variable would not. Restarted the IDE again, and now both show up. What is going on here? Thanks.
Re: Not printing in debug
Posted: Thu Mar 04, 2021 12:17 am
by Axolotl
Hi JaxMusic,
I checked your code. It works.
Please look at Menu Debugger | Use Debugger -- maybe the Menuitem is not checked.
Hint:
I recomment the use of EnableExplicit and Define or Global.
Code: Select all
EnableExplicit
Define Sql.s ;SQL string For commands
Global DBName.s ;Database name
Re: Not printing in debug
Posted: Thu Mar 04, 2021 2:28 am
by JaxMusic
Axolotl wrote:Hi JaxMusic,
I checked your code. It works.
Please look at Menu Debugger | Use Debugger -- maybe the Menuitem is not checked.
Hint:
I recomment the use of EnableExplicit and Define or Global.
Code: Select all
EnableExplicit
Define Sql.s ;SQL string For commands
Global DBName.s ;Database name
I checked that before posting and it was enabled. Strange behavior.
Re: Not printing in debug
Posted: Thu Mar 04, 2021 2:46 am
by Fangbeast
Tried your code 8 times, debug worked every time. On the rare occasion that I've had strange problems with debug on this machine, it was always with the 64 bit version of pb. Other people may not have any problems though.
Tried the way below, still debugs. I am always using the x86 version of pb as I never have any strange problems like this with it. That's my personal experience though.
Code: Select all
UseSQLiteDatabase()
EnableExplicit
Define.s Sql.s = "Select count(PersonName) As RowCount from Test_names" ; SQL string For commands
Define.s DBName.s = "Test.sqlite" ; Database name
Debug DBName
Debug Sql
Also tried the below, still debugs on this machine
Code: Select all
UseSQLiteDatabase()
EnableExplicit
Global.s Sql.s = "Select count(PersonName) As RowCount from Test_names" ; SQL string For commands
Global.s DBName.s = "Test.sqlite" ; Database name
Debug DBName
Debug Sql
Re: Not printing in debug
Posted: Thu Mar 04, 2021 3:55 am
by JaxMusic
Fangbeast wrote:Tried your code 8 times, debug worked every time. On the rare occasion that I've had strange problems with debug on this machine, it was always with the 64 bit version of pb. Other people may not have any problems though.
Tried the way below, still debugs. I am always using the x86 version of pb as I never have any strange problems like this with it. That's my personal experience though.
Code: Select all
UseSQLiteDatabase()
EnableExplicit
Define.s Sql.s = "Select count(PersonName) As RowCount from Test_names" ; SQL string For commands
Define.s DBName.s = "Test.sqlite" ; Database name
Debug DBName
Debug Sql
Also tried the below, still debugs on this machine
Code: Select all
UseSQLiteDatabase()
EnableExplicit
Global.s Sql.s = "Select count(PersonName) As RowCount from Test_names" ; SQL string For commands
Global.s DBName.s = "Test.sqlite" ; Database name
Debug DBName
Debug Sql
Yes, the code works. It worked after I restarted PB the second time. Hopefully these things are rare. I wasted a lot of time commenting out code and testing what looks like a bug in either the IDE or compiler.