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.

Procedure Viewer

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

x
Procedure: How to Create a Comment Component

In the Procedure window:

  1. Click and hold a component connector (yellow diamond), then drag the arrow pointer to the Other button 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

x
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/asterisk on every line.


Top of page

x
Procedure: How to Add/Remove Comments in the Text Editor

The option to add/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 the 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.

      Explorer image

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

      Edit Text

    3. In the Explorer view, select Text Editor from the Command menu.

      Explorer view diagram

      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.

    Add Comment

    A dash/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.


WebFOCUS