Step 3. Set Breakpoints
FRM045 - Using LANSA Debug
In this step you will learn how to set breakpoints in a form. A breakpoint is a location where the form will stop execution so that you can review the code or variables. You will add a breakpoint at the beginning of the UPDATE button click event, before any data is written to the file.
1. Scroll down to the event handling routine to UPDATE.Click
Note: You can rapidly move to any routine in your code, by using the tab. Expand routines and click on any one to move to that line in the editor.
2. Press the F9 key to set a breakpoint on this line. The line is highlighted in red.
Note: You can set break points both before executing Debug and while running in Debug. Breakpoints are remembered in both cases (they are saved when you close the form in the editor).
3. Press F5 to execute the form. Enter ADM as the department code and click the Fetch button. The form will display the Administration department. Leave the value of the Department Description as it is and click the Update button. When the form reaches the breakpoint, source code will be redisplayed.
4. Display the Breakpoints tab. The new breakpoint will be listed as follows:
The program will now stop before executing this line of code. This will allow you to view and change the variables or make other changes to debug settings.
5. Scroll to the top of the code and set the focus on the GROUP_BY command and press F9. Notice that this command is not highlighted. You can only set breakpoints on executed lines of code. The GROUP_BY is a definition used for compilation and is not used at execution time.
6. Press the F5 key to execute the application until the next breakpoint. Since there are currently no more breakpoints, the UPDATE will be processed and the form redisplayed.