The Comment Component

In this section:

How to:

When you create and open a WebFOCUS graphical procedure, a component called Comment appears by default in the Procedure window. It contains the name you assigned to the procedure, as shown in the following image.

The type of component and the information contained in it are previewed below the -* icon. The characters -* are required to identify text as a comment.

By default, the Comment component includes a comment containing the name of the procedure. This comment is not necessary for your application, and if you wish, you can delete it. You can also expand it by typing additional comments, introducing each new line with the comment characters -*.

Top of page

Procedure: How to Create a Comment Component

In the Procedure window:

  1. Click a component connector (yellow diamond), then drag the arrow pointer to the Other option on the component toolbar. The Text Editor opens.
  2. Type your comment, beginning with the characters -*. Each line of the comment must begin with -*.
  3. Close the Editor and update the procedure when prompted. The text is added to the procedure as a new Comment component.

Top of page

Adding and Removing Comments in the Text Editor

A comment option is available in the Text Editor, which enables you to add and remove comments for selected lines of WebFOCUS code. You may use the Text Editor to create, view, and edit the source code for procedures.

The comment option gives you the ability to comment out an entire block of code, without manually typing in a dash and asterisk (-*) on every line.

Top of page

Procedure: How to Add or Remove Comments in the Text Editor

The option to add or remove comments is available from the stand-alone Text Editor and the Text View of the Procedure Viewer.

Note: The comment option is not available while viewing the Source code from Report Painter.

  1. To open the procedure in a Text Editor:
    1. In the Explorer view, right-click a Procedure file (.fex) and select Edit in Text Editor, as shown in the following image.

    2. In the Procedure Viewer, right-click a procedure component (for example, Report, Graph, Other), and select Edit Text, as shown in the following image.

    3. In the Explorer view, select Text Editor from the Command menu, as shown in the following image.

      Select a procedure from the Open dialog box, or create a new procedure file (.fex).
    The Text Editor opens.
  2. Select the portion of WebFOCUS code that you would like to comment and select Add Comment from the Edit menu.

    Note: You may apply comments to a block of code or to a single line.

    The following image shows the Add Comment option.

    A dash and asterisk (-*) is added to the selected block of code.

    code block image

    Note: Comments (-*) are added to the beginning of the selected lines.

  3. To remove the comment, select the commented lines of code and select Remove Comment from the Edit menu.

    The comment (-*) is removed from the beginning of the selected lines of code.

    Tip: You may also select the Add and Remove Comment selections from the right-click menu and by using the shortcut keys. Ctrl+M adds a comment. Ctrl+R removes a comment.