Skip to main content
K.Daube
Community Expert
Community Expert
March 29, 2016
Answered

ESTK breakpoints not breaking

  • March 29, 2016
  • 1 reply
  • 812 views

Dear all,

For real debugging the breakpont mechanism is not helpfull in many cases:

  • Breakpoints work as intended for scripts which run in the ESTK
  • As soon as FrameMaker is involved, things become more complicated:
  • As long as I can invoke functions from within ESTK it works as without FM
  • As soon as a function is called via menu, the  breakpoints do not halt execution.

Therefore I have used a mechanism logging each entrance into a function (and the leave) and Alert/Console statements in the code.

Stopping at a breakpoint and tip toeing through the following code would of course be a more elegant method, especially with the Data Browser open.

It's my impression that the ES engine in FM does not know about the breakpoints set in ESTK.

Are my expectations to breakpoints wrong or is it just this way?

This topic has been closed for replies.
Correct answer Klaus Göbel

Hi Klaus,

when you start a script via FrameMaker, the ESTK isn't involved any longer.

To stop at certain points  you can use alerts.

But there is a way to use breakpoints without starting the script in debugging mode from ESTK. I have to admit that I didn't test it yet.

Have a look at Javascript Tools Guide page 218 :

Dollar ($) object functions

bp()

$.bp ([condition])

Executes a breakpoint at the current position.

condition: Optional. A string containing a JavaScript statement to be used as a

condition. If the statement evaluates to true or nonzero when this point is reached,

execution stops.

If no condition is needed, it is recommended that you use the JavaScript debugger

statement in the script, rather than this method.

It doesn't look very comfortable, but it should work.

1 reply

Klaus Göbel
Klaus GöbelCorrect answer
Legend
March 30, 2016

Hi Klaus,

when you start a script via FrameMaker, the ESTK isn't involved any longer.

To stop at certain points  you can use alerts.

But there is a way to use breakpoints without starting the script in debugging mode from ESTK. I have to admit that I didn't test it yet.

Have a look at Javascript Tools Guide page 218 :

Dollar ($) object functions

bp()

$.bp ([condition])

Executes a breakpoint at the current position.

condition: Optional. A string containing a JavaScript statement to be used as a

condition. If the statement evaluates to true or nonzero when this point is reached,

execution stops.

If no condition is needed, it is recommended that you use the JavaScript debugger

statement in the script, rather than this method.

It doesn't look very comfortable, but it should work.

K.Daube
Community Expert
K.DaubeCommunity ExpertAuthor
Community Expert
March 31, 2016

Thank You Klaus, for Your clarification!

I also thought of this:

Rather than start the script via the menu in FM - and loosing the breakpoint function:

  • In ESTK in the script add direct function calls at the beginning to skip the menu and command section.
  • A pseude-menu with commented out alternative calls could be prepared.
  • Comment out the intial set-up of the menu

// Here are the global definitions

...

// OpenHelpFile();               //  01_menu = Documentation                         
// FMbiblioCollect();            //  02_menu = 1  Collect temp. citations           
// FMbiblioCallBibapp();         //  03_menu = 2  Call biblio application           
  FMbiblioResolve();             //  04_menu = 3a Resolve temp. citations           
// FMbiblioExpand();             //  05_menu = 3b Expand temp. citations in footnotes

...

// Herafter the function section begins

I remember that about a year ago I used this method - but then again forgot about it.