Step 5. Set Breakpoint Properties
FRM045 - Using LANSA Debug
1. Close your Department Maintenance form and switch to the VL editor. Add a BEGIN_LOOP/END_LOOP at the beginning of the UPDATE.Click event handling routine.
Loop 10 times using STD_COUNT as the loop count and display a message 'Message number is nn' containing STD_COUNT. Your code should look like the following:
Evtroutine Handling(#UPDATE.Click)
Begin_Loop Using(#STD_COUNT) To(10)
Message Msgtxt('Message number is ' + #std_count.asstring)
End_Loop
Update Fields(#FORMDATA) In_File(DEPTAB) Val_Error(*NEXT)
. . . . .
This provides a line of code which executes a number of times, each time the UPDATE.Click event routine runs.
2. Compile your form.
3. Run the form in debug. When the program stops at the Initialize routine, scroll down to the UPDATE.Click event handling routine and clear the breakpoint on the UPDATE statement.
There are a number of ways you can do this. For example:
a. select this line of code and press
or use the Toggle Breakpoint button on the ribbon.b. select this line of code and use the right mouse menu option,
c. display the
tab, select this breakpoint and use the toolbar button.4. Select the MESSAGE command inside the loop and press
to set this as a breakpoint.5. Use the right mouse menu option while selecting the MESSAGE command to show the
dialog.
6. Set a Pass count of 3. During an update, the loop will now execute twice and break on the third execution of the MESSAGE command.
7. Press
to execute the form, Fetch a department and press the Update button. Debug should break when the MESSAGE command executes the 3rd, 6th and 9th time.8. Close your form.
9. Remove the breakpoint from the MESSAGE command.