WebFOCUS Maintain Application Debugger

In this section:

How to:

Reference:

The WebFOCUS Maintain Application Debugger allows you to step through your Maintain application while running on the web to assist in identifying and correcting problems encountered at run time. It is a useful debugging tool that can be enabled during the development cycle or when troubleshooting a problem in a production environment.

A Help feature is available through the debugging tool to provide specific instruction on its use.


Top of page

x
Syntax: How to Invoke the WebFOCUS Maintain Application Debugger

The following command can be used to run your WebFOCUS Maintain application using the Maintain Application Debugger:

MNTCON APPDEBUG EX procedure

where:

procedure

Is a Maintain procedure with an .mnt extension.

This command is available from the default WebFOCUS Maintain launch form, WFMSTART.HTML by choosing the option, Execute a procedure with Maintain Application Debugger from the drop-down list for Invocation Type.

You can also add this command to your own launch form or embed it in a URL call.

This is the most flexible way to launch the debugger, as it will immediately launch the application using the debugger without requiring a separate compile step, and without leaving a compiled module (FCM or FOCCOMP) behind.


Top of page

x
Reference: Alternate Methods of Invoking the Maintain Application Debugger

Other methods used to invoke the Maintain Application Debugger:


Top of page

x
Debugger Screen

The Maintain Application Debugger screen consists of the following components:

Top Left

Top Right

Left, Under View Data

Right, Under Command Buttons

Select File: Name of the Maintain procedure and associated Winform (Combo Box)

Command buttons for the following actions:

  • Set Break Point
  • Run
  • Step Into
  • Step Over
  • Help
  • Exit

Variables Frame (VF): Displays details about Global Variables and stacks.

File Frame (FF): Shows the Maintain procedure code and the current position as the application is run.

Select Case: All of the Cases in the current Maintain Procedure (Combo Box)

View Data: Global Variables or individual stack names; controls what you see in the Variables Frame (Combo Box)



x
Debugging Your Application

The following example shows how to use the debugger.



Example: Loading the Application Into the Debugger

This example describes how to load the application into the debugger.

  1. Start the debugger, using one of the methods described in How to Invoke the WebFOCUS Maintain Application Debugger.

    The main file appears in the File Frame. The color green indicates that a line is commented. A blue line is the current line where the debugger is paused. This line is not yet executed.

  2. To run the application up to the end or to the nearest break point, click Run.
  3. You can run your application either line by line or by setting and using break points.
    1. To execute a line:
      • Execute the current line and click Step Over to advance to the next line.
      • Execute the current line and stop inside another case (if the current line contains a call to another case). Next, click Step Over.
    2. To set break points:
      • Click the line where you want to set the break point. When first clicked, the line is highlighted in a gray frame.
      • Click Set Break Point or press F9. The line changes to red.
      • To deselect a break point, select the line again and, once more, click Set Break Point or press F9.

      Note: If you try to set a break point to a commented line or to an empty line, you will see the message Cannot set break point.

  4. To terminate the debugger, click Exit, which accesses the launch form.

Top of page

x
Tracking Variables

Global variables and Stacks. When you change the Category in the View Data Combo Box, the corresponding variable group appears in the Variables Frame. If the variable is not set, its value displays as #empty. When viewing a stack, you can see FocCount and FocIndex and the current stack position. To change the stack position use the first, next, prev and last navigation links.

Changing variable values. Currently it is possible to change values only for Global Variables. To change the value, click the variable value in the Variable Frame, enter a new value, and click Enter or just remove focus from the current control. The new value turns red.

Note: First the variable is set, then the current line is executed. At this point, the variable is changed on the screen only. It is not yet set inside the application (or Maintain server). It is set only when the debugger connects to the server, that is, when you click Step Over or when you change the current file by using the Select File: Combo Box.

If the value entered cannot be set (is not valid), the alert message, Cannot set value displays and the variable value is shown as 0.


Top of page

x
Navigation Control

How to:

Reference:

The Select File ComboBox lists the name of the Maintain procedure that is currently running, and the associated Winform and import modules, if any. The Select Case: Combo Box contains a list of all cases of the current file.



x
Procedure: How to Select a File and Find a Case
  1. To change the current file, select another file from this Combo Box. The debugger will go to the Maintain server and load the selected file into the File Frame.

    At this time, running the Winform file itself with the debugging functions (setting break points, and so on) is not supported.

    External procedures and remote Call procedures are not listed here. They run as part of the main application and data is returned to the calling procedure and available to the debugger. However, the debugging functions are not available for the remote procedures themselves.

  2. To go to a Case, select a name from Select Case: Combo Box. The File Frame scrolls to the selected case and the beginning of the case is highlighted in blue-green.


x
Reference: Error Messages and Type Statements

If a non-critical run time error occurs, an alert message pops up when the next debugger screen displays.

Type statements are seen only at the end of the application execution in the case of non- Winform applications, or after the Winform Show command in the case of applications with Winforms.



x
Reference: Usage Notes: Debugger Limitations

WebFOCUS