About Duffbert...

Duffbert's Random Musings is a blog where I talk about whatever happens to be running through my head at any given moment... I'm Thomas Duff, and you can find out more about me here...

Email Me!

Search This Site!

Custom Search

I'm published!

Co-author of the book IBM Lotus Sametime 8 Essentials: A User's Guide
SametimeBookCoverImage.jpg

Purchase on Amazon

Co-author of the book IBM Sametime 8.5.2 Administration Guide
SametimeAdminBookCoverImage.jpg

Purchase on Amazon

MiscLinks

Visitor Count...



View My Stats

« Which Versions of Linux are Supported to Run the Domino Server? | Main| What Are Directory and Database Links? How Are They Used? »

LotusScript Debugger Does Not Display During Script Execution

Category Software Development

One of those "gotchas" that I occasionally run into...  From the KnowledgeBase...

LotusScript Debugger Does Not Display During Script Execution

Document Number:  1086854

Problem
In Notes, you open a new or existing document and then select File, Tools, Debug LotusScript to enable the script Debugger.  When you subsequently perform an action that runs a script (such as clicking a button that includes LotusScript in its click event), the script runs without displaying the Debugger.

Content
In order to have the LotusScript Debugger displayed during script execution, the Debugger must be enabled prior to opening the relevant document.  (Additional information on the Debugger is provided in the Supporting Information section below.)

In addition, if an object has script in more than one of its events, by default, only the first event is displayed in the Debugger.  For example, if code exists in both the QueryOpen and QuerySave events of a form, when a document is created with the form, only the script in the first event (QueryOpen in this case) is debugged.   This issue also occurs when an event is triggered recursively.

Workaround:

You can debug the subsequent script(s) using one of the methods below.

Method #1:

1.        As soon as the Debugger displays for the first event, switch to the event(s) you wish to debug.
2.        Place a break point anywhere in the event.  If you wish to debug the entire script, place the break point at the first executable line of code.  (Break points cannot be placed on Dim statements or remarks.)
3.        After the Debugger exits the first event, the Debugger will stop at the next break point it encounters (such as the break point you created in step #2).  You will be able to continue debugging from this point.

Method #2.

Use the LotusScript Stop function to cause the Debugger to stop in desired events.  The function must be added to the code at design time.  (If you do not have the ability to edit the agent's design, use Method #1 instead.)

Add the Stop function to the first line of the event, for example:

Sub Initialize
      Stop
      Dim Workspace as New NotesUIWorkspace
      ..

Supporting Information:

Details on the Debugger:

The menu commands for toggling the Debugger (File, Tools, Debug LotusScript) are always available so that you can turn the Debugger off (or on) before entering a scripted area.  

In some cases, you may wish to toggle the Debugger off and on with some frequency as you move between scripted areas (especially when only certain areas require debugging).  If, for example, you wish to create a second document from a form you have just debugged, you may want to disable the debugger before creating the second document.

Comments

Gravatar Image1 - Have you tested either of these two methods?

Method #1 simply does not work in all instances. For instance, I have an agent that opens a form. The debugger terminates when the agents completes reguardless of the number or placement of breakpoints I place in any code anywhere. Scripts that run in buttons cannot be debugged because the debugger already terminated.

Method #2: The method you describe is in direct conflict with the Designer help file. The "Stop" statement only works in the remote debugger, and nowhere else. If the script debugger ignores all stop statments.

I have been fighting this issue since Notes 4.5 Things have not improved.

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)

Want to support this blog or just say thanks?

When you shop Amazon, start your shopping experience here.

When you do that, all your purchases during that session earn me an affiliate commission via the Amazon Affiliate program. You don't have to buy the book I linked you to (although I wouldn't complain!). Simply use that as your starting point.

Thanks!

Thomas "Duffbert" Duff

Ads of Relevance...