MENU

Code for IBM i: Useful extensions other than Code for IBM i

Code for IBM i | Part 5: Useful extensions other than Code for IBM i
By Makoto Ogawa, T&Trust K.K.

 

We have so far explained how to use Code for IBM i, but there are other valuable extensions for program development on IBM i. Let us introduce them all at once here.

CL

CL is an extended function that provides the following functions when editing CLP and CLLE source code.

・Code completion function when entering CL commands
・Outlines

After installing this extension, the message shown in Figure 49 will appear in the lower right corner of the screen when you first connect to IBM i.

Figure 49   Confirmation of CL Prompt Tool Installation
Figure 49    Confirmation of CL Prompt Tool Installation

If you click Yes here, the necessary programs and other components for the ILEDITOR library will be installed. Note that the code completion function for CL commands cannot be used unless this component is installed. Also, the above screen will disappear after a while, so if this happens or you click No by mistake, reconnect, and the screen will reappear.

Now, let’s look at the code completion function. When creating a CL program, SEU allows you to use the prompt function when entering commands. This code completion function provides the same functionality.

First, after typing the command you want to enter, press the space key, and you will see a list of typical parameter candidates and an option to insert all parameters (Figure 50).

Figure 50   Insert all parameters
Figure 50   Insert all parameters

Clicking on All parameters to insert all parameters will insert all keywords (Exhibit 51).

Figure 51   Insert all keywords
Figure 51   Insert all keywords

For some keywords, pressing Ctrl + spacebar within the brackets will display possible input candidates. Using this function, coding CL programs may be done in VSCode with almost no problems (Figure 52).

Figure 52   Display of Input Candidates
Figure 52   Display of Input Candidates

In addition, outlines, which are not available in SEU, are also supported. An outline is a function that displays a list of files, variables, subroutines, etc., in a CL program. Furthermore, when an item is clicked in the outline view, the cursor moves to the corresponding position in the source code, which is more convenient for programs with many steps (Figure 53).

Figure 53    Displaying an outline
Figure 53    Displaying an outline


RPGLE 

This extended function provides the following functions when editing RPGLE source code.

・Code completion function at the time of input
・Outline
・Support for input in fixed position entry format (RPGLE)

The code completion function is a useful feature when coding free-form RPG. It displays candidates when entering functions or RPG instructions.

For example, function candidates are displayed if you input up to %f after an if instruction (Figure 54).

Figure 54 Function candidate display
Figure 54 Function candidate display

If you select %found as the input, it will be inserted as shown in Figure 55, including the contents to be input.

Figure 55  Result of selecting %found
Figure 55   Result of selecting %found

If you input “for,” candidates are displayed in Figure 56.

Figure 56   Candidate display of for
Figure 56   Candidate display of for

If you select “for” at the top, the code including endfor is inserted as shown in Figure 57.

Figure 57   Selection result of for
Figure 57  Selection result of for

In addition, the outline function is provided as well as the CL extension function (Figure 58).

Figure 58   Display of outline
Figure 58   Display of outline

Author
Makoto Ogawa

President and CTO,CIO
T&Trust K.K.
https://www.tat.co.jp/

Since 1989, he has been responsible for system development and programming training on AS/400. He learned how IFS works on OS/400 V3R1 through Linux, and since then, he has been deeply interested in open source in IBM i. His theory is that developer needs knowledge of Linux to understand IBM i. He has also written many articles for i Magazine.

[i Magazine・IS magazine]    https://www.imagazine.co.jp/

新着