Getting Started


Completing the functions

The following are functions in the sample program:

You already defined minimum forms of some of these functions before you ran an intermediate test of the program. Now you need to finish defining them.

Complete the GET-LIST function first.

Figure 77. Program Editor

Figure samplpr7 not displayed.

To define GET-LIST:

  1. In the Program Editor, double-click on GET-LIST.
  2. In the Function Editor, enter the following statements:
    move custmap.cusnum to cusnum;
    ***---- SETINQ CUSTOMER ------***
    move 0 to count;
    move 0 to last;
    while ezesqcod = 0 and count < 10;
    read-and-save();
    end;
    forwards();
    

    Note:You already defined the I/O option and I/O object. Add the text around the line containing the name of the I/O option and I/O object as shown here. The first line of the example should be entered on line one. The second line of the example should be entered on line three. Line numbers are displayed in the top right corner of the editor beside the I/O Object drop-down list box. The first number is the line your cursor is on. The second number is the number of the column your cursor is in.
  3. From the Tools menu, select Validate and Format.
  4. VisualAge Generator will validate and format the statements. You must correct any errors before you save the part.
  5. From the File menu, select Save.
  6. Your function should look like the one shown in Figure 78.
  7. Close the Function Editor.

    As shown in Figure 79, READ-AND-SAVE and FORWARDS have been added to the program diagram under GET-LIST.

Figure 78. Function Editor

Figure getlist not displayed.

Now, you can finish defining the BACKWARDS function.

Figure 79. Program Editor

Figure samplpr8 not displayed.

To define BACKWARDS:

  1. In the Program Editor, double-click on BACKWARDS.

    The New Part Package/Application window is displayed.

  2. Ensure that tutorial is selected, and select OK.

    The new part is created and the Function Editor is displayed.

  3. Enter the following statements:
    sub2 = last - 5;
    if sub2 < 1;
    move "Top of Customer file" to ezemsg;
    else;
    last = sub2 - 5;
    if last < 0;
    move 0 to last;
    end;
    move-it();
    end;
    
  4. From the Tools menu, select Validate and Format.

    VisualAge Generator will validate and format the statements. You must correct any errors before you save the part.

  5. From the File menu, select Save.

    Your function should look like the one shown in Figure 80.

  6. Close the Function Editor.

    As shown in Figure 81, MOVE-IT has been added to the program diagram under BACKWARDS.

Figure 80. Function Editor

Figure backards not displayed.

Now, you can finish defining the FORWARDS function.

Figure 81. Program Editor

Figure samplpr9 not displayed.

To define processing statements for FORWARDS:

  1. In the Program Editor, double-click on FORWARDS.

    The New Part Package/Application window is displayed.

  2. Ensure that tutorial is selected, and select OK.

    The new part is created and the Function Editor is displayed.

  3. In the Function Editor, enter the following statements:
    if last = count;
    move "No more Customer Records" to ezemsg;
    else;
    move-it();
    end;
    
  4. From the Tools menu, select Validate and Format.

    VisualAge Generator will validate and format the statements. You must correct any errors before you save the part.

  5. From the File menu, select Save.

    Your function should look like the one shown in Figure 82.

  6. Close the Function Editor.
  7. In the Program Editor, MOVE-IT has been inserted under FORWARDS in two places.

Figure 82. Function Editor

Figure forwards not displayed.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]