Page 1 of 1

Debugging DBPro commands (doesn't step)

PostPosted: Thu Dec 08, 2016 8:14 am
by dpayer
I ran into a problem while updating some code. I want to make sure i understand the expected functionality of DBPro and Neobook.

In my code, I set up several points to examine where my error is by using the "debugbreakpoint" command (see code below).

While running the code in the development environment, it stops at the correct location but when I click on the STEP button to go through each next step one command at a time, it fails to stop/step. It continues through the next steps until it reaches the next debugbreakpoint.

Am I missing something or can we not 'step' through DBPro commands?


Syntax: [ Download ] [ Hide ]
Using Neobook Syntax Highlighting
StrParse "[DateTimeNow]" " " "[DateTimeStr]" "[tmp]"
debugbreakpoint "check DateTimeStr1"
If "[DeviceDisposition]" "=" "Return"
   dbpExecSQL "CDMADB" "UPDATE modems |SET Status='inactive' |WHERE (MDN='[ThisMDN]') AND (Status='ACTIVE')" ""
 debugbreakpoint  "check vars"

                 dbpAddRecord "CDMADB" "modems"
                 dbpSetAutoEdit "CDMADB" "modems" "No"
                 SetVar "[cdmadb.modems.MDN]" "[ThisMDN]"
                 SetVar "[cdmadb.modems.Vendor]" "[cdmadb.altesntable.Vendor]"
                 SetVar "[cdmadb.modems.ESN]" "[ESNEntry]"
                 SetVar "[cdmadb.modems.DECESN]" "[CDMADB.altesntable.DECESN]"
         SetVar "[cdmadb.modems.DateActive]" "![MonthNum]/[DayNum]/[Year]"
          SetVar "[cdmadb.modems.Location]" "[CDMADB.altesntable.Location]"
          SetVar "[cdmadb.modems.STATUS]" "ACTIVE"
          SetVar "[cdmadb.modems.devicetype]" "[CDMADB.altesntable.devicetype]"

debugbreakpoint "check vars"

dbpSaveEdits "CDMADB" "modems"
 
Parsed in 0.008 seconds, using GeSHi 1.0.8.10

Re: Debugging DBPro commands (doesn't step)

PostPosted: Thu Dec 08, 2016 12:55 pm
by mishem
The condition is false.
If you press the "Continue" button, the following commands are ignored.
If you press "step" stops on each team.

For example because the debugger will work differently.

Code: Select all
StrParse "[DateTimeNow]" " " "[DateTimeStr]" "[tmp]"
DebugBreakPoint "check DateTimeStr1"
If "[DeviceDisposition]" "=" "Return"
   dbpExecSQL "CDMADB" "UPDATE modems |SET Status='inactive' |WHERE (MDN='[ThisMDN]') AND (Status='ACTIVE')" ""
Endif
 debugbreakpoint  "check vars"

                 dbpAddRecord "CDMADB" "modems"
                 dbpSetAutoEdit "CDMADB" "modems" "No"
                 SetVar "[cdmadb.modems.MDN]" "[ThisMDN]"
                 SetVar "[cdmadb.modems.Vendor]" "[cdmadb.altesntable.Vendor]"
                 SetVar "[cdmadb.modems.ESN]" "[ESNEntry]"
                 SetVar "[cdmadb.modems.DECESN]" "[CDMADB.altesntable.DECESN]"
         SetVar "[cdmadb.modems.DateActive]" "![MonthNum]/[DayNum]/[Year]"
          SetVar "[cdmadb.modems.Location]" "[CDMADB.altesntable.Location]"
          SetVar "[cdmadb.modems.STATUS]" "ACTIVE"
          SetVar "[cdmadb.modems.devicetype]" "[CDMADB.altesntable.devicetype]"

debugbreakpoint "check vars"

dbpSaveEdits "CDMADB" "modems"

Re: Debugging DBPro commands (doesn't step)

PostPosted: Fri Dec 09, 2016 2:40 pm
by dpayer
Mishem, thanks for responding but I did not post all my code, only the part that I was having a problem with. In this particular case, a previous action made the condition true and the app continued as expected to the next debugbreakpoint command.

I then attempted to have it step, using the step button (versus the continue button) and it does NOT stop at each step.

David P.

Re: Debugging DBPro commands (doesn't step)

PostPosted: Fri Dec 09, 2016 6:17 pm
by Gaev
David Payer:

I had not used DebugBreakPoint before ... so I tried it with this code ...
Code: Select all
SetVar "[varA]" "aaaaa"
DebugBreakPoint "First Stop"
SetVar "[varB]" "bbb"
SetVar "[varC]" "ccc"
SetVar "[varD]" "ddd"
SetVar "[varE]" "eee"
DebugBreakPoint "Second Stop"


When I ran this code (attached to a Button) ...

1) It pops up a window titled Breakpoint - Script Paused ... and hilites the command DebugBreakPoint "First Stop"

2) Then ...

a) If I click on the Continue Button, it pops up a window titled Breakpoint - Script Paused ... and hilites the command DebugBreakPoint "Second Stop"

b) If i click on the Step Button, it appears that nothing happened ... but a closer look at the Debug window shows that the cog-wheel next to the Pause Icon is now enabled ... clicking it repeatedly will advance your script one command at a time ... until it reaches the DebugBreakPoint "SecondStop" command ... at which point, it pops up the window titled Breakpoint - Script Paused ... and hilites the command DebugBreakPoint "Second Stop"


if this is not your experience with the above script, let us know ... otherwise, if it is different with the database commands, please describe the step by step experience.

Re: Debugging DBPro commands (doesn't step)

PostPosted: Sat Dec 10, 2016 9:32 am
by mishem
I then attempted to have it step, using the step button (versus the continue button) and it does NOT stop at each step.


I have all the stops as it should.
As written above, press "Step". Not going on any action. Further, the debugger window, click the gear icon, there is a step by step execution of the script.

Maybe I did not understand correctly what the problem is?