• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

ESTK breakpoints not breaking

Community Expert ,
Mar 29, 2016 Mar 29, 2016

Copy link to clipboard

Copied

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?

TOPICS
Scripting

Views

632

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Mar 30, 2016 Mar 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

cond

...

Votes

Translate

Translate
Enthusiast ,
Mar 30, 2016 Mar 30, 2016

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 30, 2016 Mar 30, 2016

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines