PROGRAMMING OVERVIEW AND USER INTERFACE

Using the Remote Debugger
You can use the remote debugger to step through and debug LotusScript agents running on the server. The agent you want to debug must be running at the time that you start the remote debugging tool.

More than one user can attach to and debug the same agent. However, only one user has control to debug it at any given time. A second user may get control by attaching to the same agent. This capability is useful, for instance, if you want help from a coworker in debugging an agent. You can ask the coworker to attach to and debug the server agent and that coworker can do so without having to be in the same physical location as you. Note that if you attempt to continue debugging the server agent after your coworker has attached to and begun to debug it, you will get the error, "Another user has attached to the agent and taken control. Please try to reconnect for further debugging."

Complete these steps before using the remote debugger:

1. Enable remote debugging on the server.

2. Enable remote debugging in the agent.

3. Start the remote debugger.

"To debug a scheduled LotusScript agent remotely" defines how to use the remote debugger once the server and agent are set up to allow for remote debugging.

Note Remote debugging is new with Release 6.

To enable remote debugging on the server

1. Before starting the server, in the server's notes.ini file, add the following value to the ServerTasks= list:


2. From the Server Tasks tab of the server document, select the far right tab entitled Remote Debug Manager. Set Allow remote debugging on this server to "Enabled."
3. Enter a time limit for running the rdebug task on the server in the Turnoff Server Debug after setting.
4. Enter a time interval in the Agent Wait at Start Time field if you want to force the agent to pause before running, giving you time to attach the remote debugger to the target agent. (Recommended.)

5. Check the Ports - Internet Ports - Remote Debug Manager tab, to ensure that the TCP/IP port status property is set to "Enabled."

6. Make sure you are listed on the server's Security tab as having permission to run agents.

7. Save and Close the server document.

To enable remote debugging in the agent

1. On the Basics tab of the Agent Properties box, select the On schedule Trigger radio button. Click Schedule.


2. Select the server from the "Run on" list box.

3. Add a Stop statement to the beginning of the Initialize event code in the agent. The Stop statement works as follows:


4. On the Security tab of the Agent Properties box, select Allow remote debugging.

To start the Remote Debugger

1. To run a specific agent you want to debug, either:


2. While the agent you want to debug is running on the server, select File - Tools - Remote Debugger from the menu.
3. Select File - Select Debug Target from the menu.
4. Choose the server that is running the agent from the Server list box and click Open.
5. Select the database that contains the agent and click Open.
6. Select the agent you want to debug from the Debug Target list and click Open.
To debug a scheduled LotusScript agent remotely

1. To display the agent code you want to debug in the Script pane, select the agent or script library name from the Object list box and the name of the event that triggers it or the subroutine from the Event list box on the Debug pane.


2. Select the mode with which you want to debug the code using one of the following action buttons: 3. As the code executes, the debugging results display in the Utility pane. The Utility pane contains the following tabbed sections:
TabDescription
BreakpointsLists the locations of breakpoints you have added to the code.
CallsIdentifies what is currently being executed in the agent and displays all subprograms currently on the execution stack. For example, folderDocs:INITIALIZE 5 indicates that the fifth line of the Initialize event in the folderDocs agent is the next line to execute.
OutputDisplays the server console output. Any print statements in the code or error messages appear here.
VariablesLists the variables created and their values as values are applied to them in the code. You can use the edit box at the bottom of the pane to change the value of the selected variable.

See Also