Step 4. Display/Change Variables
FRM045 - Using LANSA Debug
In this step you will learn how to display and change the variables in a program as it is executing.
1. Enter a department code of ADM and click the Fetch button. When the Administration department is displayed, leave the values unchanged and click the Update button. Once again the form will stop at the start of the UPDATE.Click event and display the source in the editor.
2. Display the Variables tab to see a list of the variables in the function. It will appear something like the following:
3. When debugging components (forms, reusable parts and WAMs) you need to be aware that many fields are components. Note that DEPTDESC and DEPTMENT are shown as type Component. If you open the context menu (right mouse click) on one of these, you will not be able to change the value:
Note that on the image above, the Set Value option is not available (grayed out).
Try right clicking on the ANSWER variable (which is a work field value in the form) and note that you could change this value.
4. To change the value of DEPTDESC you need to expand the form component iiiMntDept and then expand the component DEPTDESC and select Value as shown:
Note that the Set Value option is available.
Notice that the IIIMNTDE. The form compiled object is a Windows DLL named iiimntde.dll, as shown:
tab uses the form's to name the component, in this case
In a later exercise, this topic will be covered in more detail. In most situations your own code can refer to the form using its
and LANSA accesses the object using it's .5. Select Set Value and the Set Value dialog appears, enter a value of NEW ADMINISTRATION.
Click
and note that the new value is shown in the tab.6. Press
to run the application. The form will be redisplayed. Enter ADM in the department code and click the Fetch button.
The department record has been updated with the changed value.