Debugger and breakpoints

Hi everyone,

i just wanted to know what you guys think about that and if somebody have a hint.

I´m working on a big application and at several places within my scripts i set breakpoints while debugging.

When i deleted the breakpoints they were still there. Because the breakpoint is bound to a line number in your code, and my code changed and grew the script stops now at a BLANK line!..

I can´t get rid of this damn thing.

please, it drives me nuts…

Thanks in advance.

Greetings,

Julian

Subject: debugger and breakpoints…

This is a little something I wrote quite some time ago after experiencing the same problem. It should do the trick.

dgg

Sub main()

On Error Goto errorHandler



Const PROFILE_NAME = "breakpoints_"

Const PROMPT_CHOOSEDATABASE = 13

Dim wrkspc As NotesUIWorkspace

Dim ndbTarget As NotesDatabase

Dim nclxn As NotesNoteCollection

Dim dclxn As NotesDocumentCollection

Dim docNote As NotesDocument

Dim i As Integer

Dim intCount As Integer

Dim strNoteID As String

Dim varDbSlxn As Variant



Set wrkspc = New NotesUIWorkspace()



varDbSlxn = wrkspc.Prompt(PROMPT_CHOOSEDATABASE, "Select database . . .", "Select the database for which breakpoints are to be cleared.")

If Not(Isarray(varDbSlxn)) Then

	Print "Action cancelled . . ."

	Goto thisExit

End If



Set ndbTarget = New NotesDatabase(varDbSlxn(0), varDbSlxn(1))

Set nclxn = ndbTarget.CreateNoteCollection(False)

Set dclxn = ndbTarget.GetProfileDocCollection({SNEPNNWEU}) '// that's "some non-existent profile name nobody will ever use"



nclxn.SelectProfiles = True

Call nclxn.BuildCollection()



strNoteID$ = nclxn.GetFirstNoteId()

intCount% = nclxn.Count

For i = 1 To intCount%

	Set docNote = ndbTarget.GetDocumentByID(strNoteID$)

	If Not(docNote Is Nothing) Then

		If Strcompare(docNote.NameOfProfile, PROFILE_NAME, 5) = 0 Then

			Call dclxn.AddDocument(docNote)

		End If

	End If

	strNoteID$ = nclxn.GetNextNoteId(strNoteID$)

Next i



intCount% = dclxn.Count

If intCount% > 0 Then

	Call dclxn.RemoveAll(True)

	Print {Removed } & intCount% & { breakpoint profile documents in database "} & varDbSlxn(2) & {" . . .}

Else

	Print {No breakpoint profile documents found in database "} & varDbSlxn(2) & {" . . .}

End If

thisExit:

Exit Sub

errorHandler:

Msgbox "Error " & Err & ": " & Error$ & " encountered at line " & Erl & " of " & Getthreadinfo(1) & ".", , "Error encountered . . ."

Print "Error " & Err & ": " & Error$ & " encountered at line " & Erl & " of " & Getthreadinfo(1) & " . . ."

Resume thisExit

End Sub

Subject: RE: debugger and breakpoints…

Fantastic!Thanks for posting this

g zashin

Subject: RE: debugger and breakpoints…

I should post another short note…

Lotus: your persistent breakpoints function is broke!

Once a breakpoint is added to a script in debugger, it always comes back on the next run, even if it is “explicitly cleared”

Subject: debugger and breakpoints…

If you set your breakpoints using the debugger (F10 isn’t it?) then from v6 of Notes there was a new feature added that enabled a memory of these breakpoints between code executions. However in my experience it tends to be a little over-zealous.

In user preferences, disable the option (located in the ‘Additional Options’ list box that says “Enable persistent breakpoints in LotusScript debugger” and then restart your Notes client(s).

I now use ‘stop’ in my code to make persistent break points. A simple find and replace can remove them when I am done.