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.
- Syntax Expansion — Normally set. Clearing this box prevents the Section Editor from completing partial tokens or expanding syntax macros. Example: when this box is set, if you type in IF and press CTRL–SPACE, the Section Editor inserts the rest of an IF template conforming to 4GL syntax.
- Indent Style — Determines the column where the new line starts after you press RETURN:
- None — Line starts in left-most column.
- Auto — Line starts in same column as preceding line.
- Syntax indent — The Section Editor tries to determine where to start the line by taking current language syntax into account. The absolute integer field (default: 4) determines the amount of change for new levels of indenting.
- Tabs — You can specify either:
- Alias Filename — Enter the fully qualified filename where AppBuilder is to store alias (macro) definitions for the particular extension type. You can have as many alias files as you have languages defined. For Progress file extensions, the default aliases file is
p4gl.als
- Color Coding Button — Choosing this button opens the Color Coding Setup dialog box, described in the "Color Coding Setup" section.
- Alias Button — Choosing this button opens the Alias Setup dialog box, described in the "Alias Setup" section.
- Options Button — Choosing this button opens a syntax-specific-formatting dialog box, described in the "Options" section.
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:
- Choose the Colors button. The Color Settings dialog box opens:
![]()
- Check the Set Embedded language Color box, if appropriate.
- Select the class of token in the Screen Element list for which you wish to make changes.
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.
- Click on color swatches to set foreground and background colors, and select the radio button for style. The sample text immediately reflects your choices.
- Choose Apply to save your choices for the selected token class without also dismissing the dialog box.
- 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:
- Choose New. The Enter New Alias Name dialog box opens:
![]()
- Type in the token to be expanded and choose OK. The dialog box closes and the token appears in the list of tokens.
- 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:
- Type in this expansion string: MESSAGE “At %(loc) %(var) is %(val)”.
- Choose the Add button in the bottom row. The Enter Alias Parameter dialog box opens:
![]()
- 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.
- Repeat Step 3 and Step 4 for var and val, using Variable and Value, respectively, as the prompts. Choose OK.
- 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:
- DO/END Style — Choose between having the DO block begin on the same line as the THEN token, or on the next line at the same indent level as the IF (default).
- Insert DO/END Immediately — Normally cleared. Setting this box makes the editor create every IF template with an attached DO/END block.
- Insert blank line between DO/END — Normally cleared. Setting this box the editor include a blank line when creating a DO/END block.
- Minimum Keyword Length — Choose the number of characters you must type (default: 1 character) before the editor will consider it a possible alias token. The editor will ignore CTRL–SPACE for any string with fewer characters than this.
- Smart Paste — Normally set. Clearing this box makes the editor ignore indentation when pasting. When Smart Paste is turned on, the editor attempts to correctly indent any text that you paste.
- Indent WHEN from CASE — Normally set. Clearing this box makes the editor put the WHEN clause at the same indent level as the enclosing CASE. The editor will normally indent WHENs by one additional level.
- Keyword Case — Normally all-caps. Choose the style the editor uses when expanding aliases.
- Auto-case Keywords — Normally set. Clearing this box makes the editor ignore differences between the Keyword Case setting and how you type keywords manually. When set, the editor changes your manual style to conform to your Keyword Case choice; for example, changing a lowercase keyword to all caps.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |