Using Code Insight Functions

The workbench provides various features to help you keep track of your COBOL code. The first of these, called code parameters, provides pop-up tips explaining the syntax and basic usage rules for some COBOL verbs. This feature may be helpful for novice COBOL programmers.

The second code insight function is called code completion. When this feature is enabled, you can pause briefly after typing various COBOL verbs to see an alphabetical list of possibilities for completing your statement. For example, if you type:

CALL "

AcuBench provides a list of programs and library routines that you might want to call. Likewise, if you type MODIFY and a space, code completion provides a list of screen controls and handles on which you might want to perform a modify operation. In the latter case, after you choose an item to modify, a second pop-up box provides a list of applicable properties to be modified.

Code and parameter completion are available for the following verbs: CALL, CHAIN, CLOSE, DELETE, DESTROY, GO, INQUIRE, MODIFY, OPEN, PERFORM, READ, REWRITE, START, and WRITE.

By default, code completion is enabled, while code parameters are disabled. You can change these settings in the Tools > Options window. More information about the Tools > Options dialog box can be found in Code Insight Options.

Two other features can provide additional insight into existing code. If you have code with a good deal of nesting, or code that doesn't use indentation, or if you are having trouble parsing a statement, you can use the Find Scope and Verb Block Match commands to determine the scope, or range, of a particular statement.

To highlight the block of code corresponding to a specific statement (for example, all lines of code pertaining to a single PERFORM statement):

  1. Position the cursor anywhere within the statement or phrase.
  2. Select Find Scope from the Edit > Advanced menu (or the Editor toolbar).

    AcuBench highlights all lines of code affected by, or included in, that statement.

Similarly, you can use the Verb Block Match command to move the cursor from one end of a match verb block to the other. If you position the cursor at the start of a READ statement, for example, and select this command from the Edit > Advanced menu (or Editor toolbar), the cursor jumps to the end of the line containing the corresponding END-READ.

The workbench recognizes the following list of matched verbs as pairs:

Initial Final
Add End-Add
Call End-Call
Evaluate End-Evaluate
If End-If
Perform End-Perform
Read End-Read
Return End-Return
Rewrite End-Rewrite
Search End-Search
Start End-Start
String End-String
Write End-Write