Progress
AppBuilder
Developer’s Guide


Section Editor Preference Options

The Section Editor allows you to set preferences on a per-language basis in three broad areas:

In certain cases, Section Editor applies your settings to individual blocks of language statements within a file, not merely to the whole file indiscriminately. Thus, you can (for example) embed a block of JavaScript code in a file that is otherwise HTML code, and Section Editor correctly color-codes and formats the embedded block and the surrounding blocks differently, each in the way you have specified for the particular language.

To begin configuring your Section Editor preferences, choose Options Editing Options. The Editing Options dialog box opens:

The Section Editor determines what settings to use by looking at the filename extension. The example shows default settings for Progress 4GL source file (.w extension). The notation “Refers to ” to the right of the drop-down list indicates that changes will be written to a file common to several extensions, in this example to all extensions associated with the 4GL.

Choose the Update button to make your changes to these settings permanent.

Color Coding Setup

The Color Coding setup dialog box allows you to set the color for a particular class of token within a particular language. You can add new tokens to the most appropriate of several lists that AppBuilder maintains for the use of the recognizer:

Follow these steps to set color and style for some class of token:

  1. Choose the Colors button. The Color Settings dialog box opens:
  2. Check the Set Embedded language Color box, if appropriate.
  3. Select the class of token in the Screen Element list for which you wish to make changes.
  4. The meaning of two of the listed elements might not be immediately clear to you:

    • Window Text is any text not otherwise defined.
    • Attributes (HTML only) are recognized modifiers within an HTML tag. For example, in the tag <img src="somelocation">, “src” is an attribute.
    • Note that there are a few categories that, while still listed, are not settable in this version of the editor: Current Line, Cursor, No Save Line, Inserted Line, Line Number, and Message.

  5. Click on color swatches to set foreground and background colors, and select the radio button for style. The sample text immediately reflects your choices.
  6. Choose Apply to save your choices for the selected token class without also dismissing the dialog box.
  7. When you have finished making changes, choose OK.
Alias Setup

The Section Editor has a powerful macro-expansion capability. AppBuilder supplies predefined tokens that expand to common 4GL syntactic constructs, and using these tokens can reduce your typing effort considerably. The Alias Setup dialog box provides you the means to define additional tokens that the Section Editor will later expand in the same way:

The expansion process is straightforward. For example, when you type IF and press CTRL–SPACE, the editor adds two spaces and the keyword THEN, and places the cursor between the two embedded spaces in exactly the right position for you to enter the IF test expression. Similarly, you can type in the predefined macro &FR, press CTRL–SPACE, and the editor will expand that to be {&FRAME–NAME}.

You can add additional items for automatic expansion, or even correction. If there is some typing mistake that seems to be a favorite of yours, you can enter it together with the relevant correction, and not have to worry about it any more. The transposition DIPSLAY for DISPLAY is an example of this—that error is such a popular one that PSC has already included it in the list.

Follow these steps to add a new expansion:

  1. Choose New. The Enter New Alias Name dialog box opens:
  2. Type in the token to be expanded and choose OK. The dialog box closes and the token appears in the list of tokens.
  3. Type the expansion value into the editor. The expansion value may have multiple lines. Use %\c (percent sign, backslash, c) to represent the final position of the edit cursor, after expansion. Choose OK.

In addition to being able to define an alias that will place the cursor properly, you can define aliases that prompt for completion. For example, if you still do old-style debugging, using disclosure code, you might wish to define a disclosure message that would reveal the value of some variable at a certain point in your program. To do that follow these steps:

  1. Follow Step 1and Step 2, above, calling the new alias PEEK.
  2. Type in this expansion string: MESSAGE “At %(loc) %(var) is %(val)”.
  3. Choose the Add button in the bottom row. The Enter Alias Parameter dialog box opens:
  4. Type in loc as the parameter name, and Location as the actual prompt string. You can leave Initial Value blank for this example, unless you do want some text as the initial value.
  5. Repeat Step 3 and Step 4 for var and val, using Variable and Value, respectively, as the prompts. Choose OK.
  6. Open the Section Editor in a context suitable for testing your new alias. Type in PEEK and press CTRL–SPACE The editor immediately opens a dialog box to prompt you for the three parameters, afterward inserting the fully expanded call to MESSAGE in place of PEEK:
Options

The Options dialog box allows you to customize the appearance of your source code in various ways:

You can change as many of these values as you like:


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095