Source language: Translate to:

Debugging DBPro commands (doesn't step)

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Debugging DBPro commands (doesn't step)

Postby dpayer » Thu Dec 08, 2016 8:14 am

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.009 seconds, using GeSHi 1.0.8.10
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1382
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: Debugging DBPro commands (doesn't step)

Postby mishem » Thu Dec 08, 2016 12:55 pm

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"
mishem
 
Posts: 575
Joined: Mon Oct 08, 2012 1:51 pm

Re: Debugging DBPro commands (doesn't step)

Postby dpayer » Fri Dec 09, 2016 2:40 pm

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.
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1382
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: Debugging DBPro commands (doesn't step)

Postby Gaev » Fri Dec 09, 2016 6:17 pm

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.
User avatar
Gaev
 
Posts: 3728
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Debugging DBPro commands (doesn't step)

Postby mishem » Sat Dec 10, 2016 9:32 am

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?
mishem
 
Posts: 575
Joined: Mon Oct 08, 2012 1:51 pm


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 2 guests

cron