yoshi78
asked on
Debug My Debug Code.
Hello all,
This one should be simple enough, I'm just not seeing it.
I'm trying to solve the debug issue. See if you have the same issue. If I'm in the notes client and I switch to debug mode, notes says it's in debug mode but really isn't yet. But, if you change views and then go back, it will start the debugger. I am trying to make a generic "Switch To Debug" that I can throw in to any DB. Here's what I've got so far.
In LS:
Sub Initialize
Dim ws As New NotesUIWorkspace
Dim uidb As NotesUIDatabase
Dim uiview As NotesUIView
Dim uidoc As NotesUIDocument
Dim s As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim views As Variant
Dim NotesViewArray() As NotesView
Dim agt As NotesAgent
'Dim i As Integer
Set uidb = ws.CurrentDatabase
Set uiview = ws.CurrentView
Set uidoc =ws.CurrentDocument 'prompt for close and switch views then reopen
Set db = s.CurrentDatabase
views = db.Views
'i = Ubound(db.Views)
Forall v In views
If v.name <> uiview.View.Name Then
currentname = uiview.View.Name
selectname = v.name
Exit Forall
Else
selectname=uiview.View.Nam e
currentname = selectname
End If
End Forall
If currentname <> selectname Then
uidb.OpenView(Cstr(selectn ame))
uidb.OpenView(Cstr(current name))
End If
End Sub
**But I don't know how to switch to debug mode from LS
and in formula:
@Command([DebugLotusScript ]);
viewTitle:=@ViewTitle;
@Command([SwitchView]);
@Command([switchview];view Title);
@all;
**But I can't find the view names, namely one to switch to. @viewtitle will get the current for me, but I need to find an alternative view if one exists and use it in the first switchview. It works now but I have to manually select a view via a goto dialog when the first switchview is executed.
Okay, There's my predicament. Thanks greatly for the help. This is just a fun side tool that I've wanted. If anyone has an alternative suggestion I'm up for that too.
This one should be simple enough, I'm just not seeing it.
I'm trying to solve the debug issue. See if you have the same issue. If I'm in the notes client and I switch to debug mode, notes says it's in debug mode but really isn't yet. But, if you change views and then go back, it will start the debugger. I am trying to make a generic "Switch To Debug" that I can throw in to any DB. Here's what I've got so far.
In LS:
Sub Initialize
Dim ws As New NotesUIWorkspace
Dim uidb As NotesUIDatabase
Dim uiview As NotesUIView
Dim uidoc As NotesUIDocument
Dim s As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim views As Variant
Dim NotesViewArray() As NotesView
Dim agt As NotesAgent
'Dim i As Integer
Set uidb = ws.CurrentDatabase
Set uiview = ws.CurrentView
Set uidoc =ws.CurrentDocument 'prompt for close and switch views then reopen
Set db = s.CurrentDatabase
views = db.Views
'i = Ubound(db.Views)
Forall v In views
If v.name <> uiview.View.Name Then
currentname = uiview.View.Name
selectname = v.name
Exit Forall
Else
selectname=uiview.View.Nam
currentname = selectname
End If
End Forall
If currentname <> selectname Then
uidb.OpenView(Cstr(selectn
uidb.OpenView(Cstr(current
End If
End Sub
**But I don't know how to switch to debug mode from LS
and in formula:
@Command([DebugLotusScript
viewTitle:=@ViewTitle;
@Command([SwitchView]);
@Command([switchview];view
@all;
**But I can't find the view names, namely one to switch to. @viewtitle will get the current for me, but I need to find an alternative view if one exists and use it in the first switchview. It works now but I have to manually select a view via a goto dialog when the first switchview is executed.
Okay, There's my predicament. Thanks greatly for the help. This is just a fun side tool that I've wanted. If anyone has an alternative suggestion I'm up for that too.
ASKER
This still asks me which view to switch to(@PostedCommand([SwitchV iew]);). I'm looking, if it's in formuala language, for a way to grab the view names so I don't have to ask which view to switch to.
Thanks for the input Heman.
Yoshi
Thanks for the input Heman.
Yoshi
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I was about to say that this wouldn't do anything, but then I tried it and apparently it doesn't care which view - even if it's the current view - it switches to, it works.
Very Nice Job.
Thanks for sorting my little problem out.
Yoshi
Very Nice Job.
Thanks for sorting my little problem out.
Yoshi
try this instead
@Command([DebugLotusScript
viewTitle:=@ViewTitle;
@PostedCommand([SwitchView
@PostedCommand([switchview
~Hemanth