Release 10.1A: OpenEdge Development:
AppBuilder

> ## Using the Section Editor

> The AppBuilder Section Editor is a capable editing utility that offers modeless text insertion, standard MS-Windows-style cut-and-paste, plus:

> - Text search-and-replace.

> - Transformation of selected text (indent/unindent, comment/uncomment).

> - Token insertion by picking from lists.

> - Whole-file insertion.

> - Undo of the most recent action, for most actions.

> - The ability to delete whole subsections.

> ##### Cutting, copying, and pasting text

> To cut a block of text, highlight the block of text, then choose Edit Cut (shortcut: CTRL-X). The Section Editor removes the block of text from the current editing area and places it in the system clipboard.

> To copy a block of text, highlight the block of text, then choose Edit Copy (shortcut: CTRL-C). The Section Editor copies the block of text and places it in the system clipboard.

> Once a block of text has been cut or copied into the system clipboard, you can paste it at any current cursor location by choosing Edit Paste (shortcut: CTRL-V).

> ##### Finding and replacing text

> Within the current editing area, you can search for and replace text strings. To search for a text string, choose Search Find (shortcut: CTRL-F). The Find dialog box appears, as shown in Figure 2–10.

> Figure 2–10: Find dialog box

> In the Find What field, type the text string that you want to find. Set search options as needed:

> - Activate the Match Case toggle box to make the search case-sensitive.

> - Activate the Down radio button to search forward; activate the Up radio button to search backward.

> - Activate the Wrap at Beginning/End toggle box to specify that upon reaching the beginning or end of the current editing area, you return to the top or bottom and begin to search again.

> When you choose OK, the Section Editor searches for the first instance of the text string.

> To find the next instance of the text string, choose Search Find Next (shortcut: F9). To find the previous instance of the text string, choose Search Find Previous (shortcut: SHIFT-F9).

> To replace instances of the text string with a different string, choose Search Replace (shortcut: CTRL-R). The Replace dialog box appears, as shown in Figure 2–11.

> Figure 2–11: Replace dialog box

> The following search and replace features are available:

> - Find What — Enter the substring to be searched for.

> - Replace With — Enter the replacement substring.

> - Match Case — Activate this toggle box to match the search target’s case.

> - Search All Sections — The default search-and-replace is local to the section being edited. To search globally within the current file, check this box.

> - Replace All — Click on this button to replace all occurrences of the target substring without further confirmation.

> When you use the Replace All option, a message box displays indicating the Replace All is complete and the number of occurrences that were replaced.

> ##### Transforming text

> A block of selected text can be indented, unindented, commented out, or uncommented by choosing Edit Format Selection, and then choosing the operation desired.

> ##### Inserting text from lists

> The process of creating code involves entering many reserved words, identifiers, filenames, and similar tokens. The possibilities for error are numerous. To reduce error and, in most cases, save keystrokes, AppBuilder helps you insert text strings for these token types:

> - Database fields

> - Event names

> - Internal procedure calls

> - Preprocessor names

> - Queries

> - Object names

> - Filenames

> For each of these items, AppBuilder provides a way for you to choose or specify a text string that AppBuilder inserts into the edit buffer at your cursor location. You can access this capability by right-clicking in the editing area, or by choosing from the Insert menu.

> For detailed instructions, see the "Inserting text-string tokens from lists" section.

> ##### Inserting whole files

> You can insert (merge) the contents of a whole text file into the edit buffer at the current cursor location. This is convenient if you have used another editor to write some code that you now wish to integrate into your AppBuilder file.

> To insert the contents of a text file, choose Insert File Contents. The following dialog box opens:

> Note: Apart from the dialog box title shown by the title bar, and the end result, this is the same dialog box that appears when you choose Insert Filename. Make sure of what you are inserting.

> By default, this dialog box points to the `src/template` directory and lists the header and superprocedure files found there. You can list different files, or files in a different directory, by selecting from the choices in the respective drop-down lists. You can edit the list of directories by choosing Edit Path, and you can add a directory without editing by selecting a file using the Browse button, which invokes the standard Open File dialog box.

> ##### Saving your changes

> Since the Section Editor is a feature of AppBuilder rather than a separate utility, it has no Save option of its own. To save your changes, use the File Save or File Save As menu items in the AppBuilder main window. This will save all changes made to the current object, not just those you made using the Section Editor.

> ##### Undoing your changes

> To undo all unsaved changes made to the current editing area, choose Edit Undo All. This restores the file to the state it was in when you entered this editing area.

> To undo only your most recent unsaved change, choose Edit Undo. This option undoes your last edit. If you use Section Editor features such as Insert or Paste, Undo undoes the most recent action. Successive Undos switch between redoing and undoing the previous edit.

> ##### Deleting whole sections

> To delete all the non-AppBuilder code in a particular subsection (an individual trigger, procedure, etc.), choose Edit Delete Trigger (procedure, etc.) The menu item text varies according to the element you are currently editing.

> Caution: You cannot Undo the deletion of a whole subsection, such as a trigger. If you use the Edit Delete subsection type function, and then change your mind, you will have to re-enter all the deleted code. It cannot be recovered by using Undo or Undo All.

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