Step 3. Set Breakpoints

1.  Select Options from the File menu to open LANSA Settings. Select Debug and uncheck the Break at first executable statement check box. Click Apply and then OK to close the settings dialog. Debug will now break only at your breakpoints.

     Note that the xDepartments Server Module is currently open in the editor. Close this for now.

2.  A Breakpoint is a location where the web page will stop execution so that you can review the code or the variables.

     In the Maintain Department web page, select the mthroutine statement for Save and press F9 to set a breakpoint. The line will be highlighted in red. You can set breakpoints both before executing Debug and while running in Debug. Breakpoints are saved when you close the web page in the editor.

     To clear a breakpoint select the line and press F9 again. You can also disable a breakpoint using the context menu:

     A disabled breakpoint is highlighted in grey and is temporarily ineffective.

     Toggle breakpoint will disable the breakpoint or enable the breakpoint.

     Clear All will clear all breakpoints in this web page.

     Disable All will disable all breakpoints in this web page.

3.  Press F5 to continue running the web page and switch to the web page in the browser.

     Enter a department code and click Fetch. The department description will be displayed normally.

     Now click the Save button. Debug will stop execution at the Save method routine and highlight the breakpoint line in yellow. This is the next line to be executed.

     You can now view or change other debug settings.

     Note: Only when debugging a Windows form or reusable part, may variables be changed while debug is running.

4.  Scroll to the top of the code. Select a Group_By statement and press F9. The statement is not highlighted. You can only set breakpoints on executable lines of code.

5.  Press F5 to continue execution. Since there are no breakpoints, the update will be processed and the web page will be redisplayed having cleared the input fields. This time, the server module will not break, since the option Break at first executable code is turned off.

6.  Open the Breakpoints tab from the Tabs menu on the Home ribbon:

     The Breakpoints tab shows all breakpoint's currently set in all components, not just the currently open component.

     The toolbar buttons shown, enable all breakpoints in all components to be cleared. Alternatively, all breakpoints in all components can be disabled.

     Individual breakpoints can be managed by selecting them and the using the following toolbar buttons:

      Removes the selected breakpoint(s).

      Goes to the source containing this breakpoint, opening the component if necessary.

     Opens the Breakpoint Properties dialog for the selected breakpoint.