Workbench User Guide : Writing Scripts and Procedures : Script Editor : How You Can Edit Text with the Script Editor
 
Share this page          
How You Can Edit Text with the Script Editor
You can cut and copy text, or find and replace text.
Cut and Copy Text
Cutting text removes the original text and stores it in the paste buffer. Copying text places the text in the paste buffer without removing the original text.
To cut or copy text
1. Select the text in your script by dragging the mouse cursor over it.
2. Click Edit, Cut or Edit, Copy.
3. Position the cursor where you want to insert the text, or select the text that you want to replace.
4. Click Edit, Paste.
The contents of the paste buffer are inserted.
Copy and Paste Syntax-highlighted Text in Rich Text Format Text
Windows only The Script Editor displays syntax-highlighted text in Scintilla format. You can copy this colored text and paste it into applications that support RTF, such as web pages, emails, and Microsoft Word.
To copy and paste syntax-highlighted text
1. In the Script Edtior, select the text you want to copy.
If you do not select any text, all the text in the Script Editor window will be copied.
2. Click Edit, Copy As RTF (or press Shift+Ctrl+C) to copy the text to the clipboard.
3. Paste the text in your RTF-supported application.
To restore the former EntryField-based editor, set the II_SCINT_EDITOR environment variable to FALSE. For more information, see Environment Variables.
Find and Replace Text
You can find and replace text in the Script Editor.
To find and replace specific text in a script
1. Click Find, Find in the Script Editor.
The Search/Replace dialog appears.
2. Enter the search string (the text you want to search for) in the Find String entry field.
3. Click Ignore Case to specify whether text in the script must match the case of the search string (for example, whether “declare” in the script matches the search string “Declare”).
4. Enter a replacement string (text with which to replace the search string), if desired.
The replacement string is always inserted into the text exactly as you entered it.
5. Click one of the following buttons on the dialog:
Replace All
Replaces every occurrence of the search string in the script automatically
Find
Finds the first occurrence of the search string
6. If you selected Find and the search string is found, click one of the following commands on the Find menu:
Find Next
Finds the next occurrence of the search string
Find Previous
Finds the previous occurrence of the search string
Replace
Replaces the current occurrence of the search string with the replacement string
Replace and Find
Replaces the current occurrence of the search string and then finds the next occurrence
To find specific lines and change their text attributes
1. Click Find, Go to Line Number in the Script Editor.
The Go to Line Number dialog appears.
2. Enter the line number and click OK.
The line number you entered is highlighted.
3. Click Font, Bold to specify boldface or regular type.
Note:  Using the Font menu commands affects the Script Editor only. The type and window of the system editor are not affected.
4. Click one of the size toggles on the Font menu to specify the type size.
Note:  When you change the size of the type, the Script Editor window is resized to fit the current text.
Using Auto-complete to Insert Keywords
Windows only In the Script Editor, you can press Ctrl+Spacebar to open a popup list containing keywords from OpenROAD 4GL, OpenROAD SQL, OpenROAD events, system classes and system constants.
If your cursor is on a blank line or ahead of a space, pressing Ctrl+Spacebar opens the popup starting at the top of the keywords list.
If you type the beginning of a keyword and press Ctrl+Spacebar, the selection will jump to the first matching keyword in the list.
If a keyword beginning with the typed characters is not found in the list, the popup will not open.
Selecting a keyword using the keyboard arrow keys or the mouse and then double-clicking or pressing Enter will insert the selected keyword in your text.
Pressing Esc closes the popup.
Creating Your Own Keywords List
Windows only You can create a text file of your own keywords to add to the list of default OpenROAD-defined keywords. The keywords you add to the file must be defined.
1. Create a text file with your life of keywords delimited by the space character.
userKeyword1 userKeyword2 … userKeywordn
userKeywordn+1
2. Create the environment variable II_USER_KEYWORD_FILE to define the path and filename of your keyword file.
ingsetenv II_USER_KEYWORD_FILE path\filename
Pressing Ctrl+Spacebar will display the list of OpenROAD keywords with the contents of your list appended.
Using Word Auto-completion to Display a List of Words in the Current Script
Windows only The Script Editor will display a list of words used in the current script if you press Ctrl+Enter (Ctrl+Return). This word auto-completion popup list contains all the words used in the script, dynamically generated.
If you type the beginning of a word and press Ctrl+Enter, the selection will jump to the first matching word in the list.
If a word beginning with the typed characters is not found in the list, the popup will not open.
A word can consist of the characters a–z, A–Z, 0–9, and underscore (_).