Exercise 3.14: Checking syntax

Before you begin, you must complete Exercise 3.13: Comparing files in the CODE Editor (optional).

One of the powerful features that the LPEX Editor shares with SEU is its ability to syntax check your source. Syntax checking can be done either when the cursor leaves each line of source or all at once on either the currently selected source or on the entire source member.

Now you will create a syntax error and watch for the prompt to correct it.

To syntax check the file:

  1. Click the PAYROLLC Editor window, click Source and then click Syntax Check All on the workbench menu.
    Editor window with syntax error

    Error messages appear to draw attention to the errors.
    Editor window with syntax error

  2. Move the cursor onto the pink error message.
  3. Press F1.
    Second level help for syntax error

    This opens a window with second level help for the error.

  4. Minimize the Help window.
  5. Add the required left parenthesis to correct the error.
  6. Move the cursor off the line you just fixed.

    The error message is automatically removed from the editor.

    Tip: You can toggle automatic syntax checking. Click Window > Preferences from the workbench menu and then expand Remote Systems, iSeries, LPEX Editor Parsers, select the language you want to change the settings for in the left pane of the Preferences window and select the Automatic syntax checking check box and then click OK.
    Preferences window to turn syntax checking on or off

Now you are ready to review your knowledge of this module by taking the quiz. You can also apply what you have learned in this module by completing the practice tasks detailed in More practice.

Quiz

  1. The LPEX Editor has predefined settings, but also has an associated preference page containing settings that you can define. (T, F)
  2. LPEX Editor preferences are set in the:
    1. Preferences window
    2. Editor window
    3. New wizard
    4. Remote Systems view
  3. You can configure the LPEX Editor to adopt the keyboard and command personalities of many popular editors. (T, F)
  4. If you want to undo a set of changes made to a file you must use the _______ operation. Name the operation.
    1. Insert
    2. Replace
    3. Redo
    4. Undo
  5. You can also cancel the effects of an undo operation by using the _______ operation. Name the operation.
    1. Insert
    2. Replace
    3. Redo
    4. Undo
  6. To receive language sensitive help, press the ____ key in an Editor window. Name the key:
    1. F2
    2. F3
    3. F1
    4. F4
  7. If the cursor is ________ an operation code, you receive help for that operation code; otherwise, you receive help for the current specification.
    1. before
    2. after
    3. on
    4. off
  8. Instead of entering or changing code directly in the Editor window, you can use ________.
    1. Prompts
    2. Filters
    3. SEU commands
    4. Format line
    5. All of the above
  9. You use the _______ window to search for an item in the current source. Choose the best answer.
    1. Search
    2. Find
    3. Edit
    4. Find/Replace
  10. You can search for:
    1. A word
    2. A partial word
    3. A sequence of words
    4. A pattern if it follows the rules of regular expression
    5. All of the above
  11. The LPEX Editor allows you to ____ or subset your source so that you see only lines containing a given string.
    1. search
    2. find
    3. sort
    4. filter
  12. If you would like to search through the members in a source physical file or through the files in a local directory, you can use the _______ tool. Choose the best answer.
    1. Compare
    2. Search
    3. Find
    4. Edit
  13. The ________ tool allows you to compare different versions of a program and find the differences. Choose the best answer.
    1. Convert
    2. Migrate
    3. Compare
    4. Search
  14. There are two ways to compare files. They are Compare tool in the workbench and the Compare tool in the CODE Editor. (T, F)
  15. Syntax checking can be done either when the cursor leaves each line of source or all at once on either the currently selected source or on the entire source member. (T, F)

Module recap

You have completed Module 3. Editing source. You have learned how to:

Now that you have mastered editing source, you can move on to verifying your source to ensure you have a clean compile on the iSeries system. This approach saves you iSeries cycles! And you perform both verify and compile from the Remote Systems view! Continue to Module 4. Verifying and compiling source.