Edit Options

The following options are available via the Edit menu, the Editor window context menu, or the Edit toolbar, and work on the active

Editor window:

Undo/Redo

    • Click Edit > Undo to undo the last action.
    • Click Edit > Redo to redo (repeat) the last action.

Cut, Copy and Paste

    • Select Edit > Cut to cut the selected text to the clipboard.
    • Select Edit > Copy to copy the selected text to the clipboard.
    • Select Edit > Paste to Paste the contents of the clipboard to the active file at the cursor position.

NOTE: Hold down the Alt key and select text with the left mouse button for columnar Cut, Copy, and Paste operations.

Find, Find Next and Replace

Use these options to perform search and replace operations within the active Source Code file.

Searching within the Active File

Use the Find and Find Next options in the Edit menu to search within the active Source Code file:

  1. Choose Edit > Find to open the Find dialog (FIG. 155).

FIG. 155 Find dialog

  1. Enter a search string in the Find What field.
  2. Click one or more of the Options check boxes to set any additional search criteria as desired:
Find Dialog Options
Match whole word only Searches for instances of the search string that exist as whole words only. For example, a search for "yell", only finds the word "yell", as opposed to any instance of the search string (i.e. "yellow").
Match case Searches only for instances that match the case (UPPERCASE or lowercase) of the characters in the search string.
Regular Expression Searches for regular expressions (see

Regular Expression Support on page 86

). | | Start At Top on First Find | Start the search at the top of the file (regardless of the cursor's position). | | Loop Around | Start the search at the cursor's position, and automatically loop the cursor to either the top or bottom of the file (depending on the Direction setting) to finish searching the entire file, to the cursor's position. |

  1. Click the Direction option buttons to specify the direction of the search (Up or Down).
  2. Click Find Next to perform the search and close the Find dialog. The first instance of the search string is highlighted in the Editor window.
  3. Click Bookmark All to apply bookmarks to all found instances of the search string. See the

    Bookmarks section on page 83

    for details. Click Clear All Bookmarks to clear these bookmarks

  4. Choose Edit > Find Next to continue the search after the first instance of the search string is found.

Search and Replace within the Active File

To perform a Search and Replace operation within the active Source code file:

  1. Choose Edit > Replace to open the Replace dialog (FIG. 156).

FIG. 156 Replace dialog

  1. Enter a search string in the Find What box.
  2. Enter the replace string in the Replace With box.
  3. Click the check boxes to set additional search options as desired.
  4. Select a Replace In option (Selection or Whole File).
  5. Click Find Next to perform the search. The first instance of the search string is highlighted in the Editor window.
  6. Click Replace to replace the highlighted instance of the search string with the replace string, or click Replace All to replace all instances of the search string.

NOTE: The total number of replaced instances is indicated in the Status bar (on the left-hand side).

Goto Line

Select this option to jump to a particular line number in your code.

Note: To display line numbers in the Editor windows, select the Show Line Numbers check box in the Editor - Highlighting and Fonts tab of the Preferences dialog.

  1. Select Edit > Goto Line to access the Goto Line dialog (FIG. 157).

FIG. 157 Go To Line dialog

  1. Enter the line number in the Enter Line Number field and click OK to jump to the specified line number in the open Editor window.

Insert Section

With this option, you can insert a particular section heading in your code at the cursor's position.

  1. Select Edit > Insert Section to access the Insert Section sub-menu.
  2. Position the cursor at the beginning of the line that you want to add the section heading to.
  3. Select the section heading that you want to add from the sub-menu. The available options are:
    • DEFINE_DEVICE
    • DEFINE_CONSTANT
    • DEFINE_TYPE
    • DEFINE_VARIABLE
    • DEFINE_LATCHING
    • DEFINE_TOGGLING
    • DEFINE_MUTUALLY_EXCLUSIVE
    • DEFINE_CONNECT_LEVEL
    • DEFINE_START
    • DEFINE_MODULE
    • DEFINE_EVENT
    • DEFINE_PROGRAM

The section heading is added at the cursor's position.

Goto Section

With this option, you can jump to a particular section in your code.

  1. Select Edit > Goto Section to access the Goto Section sub-menu.
  2. Select the section that you want to jump to from the sub-menu.

NOTE: The Insert Section and Goto Section sub-menus may include sections that are not defined in the Source Code f ile being edited. The valid commands for the System type will be available whether they are actually in the f ile or not.

  1. The cursor jumps to the top of the selected section in the open Editor window.

Goto Functions/Subs

With this option, you can jump to a particular section in your code in the active Editor window.

  1. Select Edit > Goto Functions/Subs to access a list of functions contained within the active Source Code file.
  2. Select the function or subroutine that you want to jump to from the list.
  3. The cursor jumps to the top of the selected section in the Editor window.

Bookmarks

You can place bookmarks in your program files for quick navigation to key points in the code. Bookmarks are indicated by blue rectangles in the left margin of the Editor window (FIG. 158).

FIG. 158 Bookmark example

Select Edit > Bookmarks to open the Bookmarks sub-menu. Use the commands in this sub-menu to create, jump to, and clear bookmarks:

Bookmarks Sub-Menu Options
Action Description
Bookmark Click to create a bookmark at the cursor’s position.
Next Bookmark Click to jump to the next bookmark.
Previous Bookmark Click to jump to the previous bookmark.
Clear Bookmarks Click to clear all bookmarks from the active file.

To create a bookmark, place the cursor in the line that you want to bookmark, and select Edit > Bookmarks > Bookmark.

Push Messages

The PUSH keyword is used to find out if a channel has had an input change from off to on, such as when a button is pressed. If the channel has been turned on, the corresponding Push statement is activated. The operation or operations following this Push statement are only executed once after the channel is turned on.

NetLinx Studio displays the most recently received Push, or Push status (Push Enabled/Disabled) in the Status Bar (FIG. 159).

FIG. 159 Status Bar - Push Message display

Left-mouse click on the Push Message displayed to view a history of push messages. Then, right-mouse click within the list box to view the available options.

To display Push messages in the Status Bar, you must select the Enable Push Message Status Bar Display option in the Diagnostics menu. See

Enable Push Message Status Bar Display on page 164

.

NOTE: The display of Push messages can also be toggled by clicking on the Push message window in the Status Bar.

Select Edit > Push Messages to open the Push Messages sub-menu:

Push Messages Sub-Menu Options
Action Description
Insert Push Message Select to open the Insert Push Message dialog. This dialog displays a list of recent Push messages that were sent to the Master. Click to select a Push from the list, and click OK to insert the code for that at the cursor's position in the active file.
Find Push Message Select to open the Find Push Message dialog. This dialog displays a list of recent Push messages that were sent to the Master. Select a Push from the list, and click OK to locate the selected Push Message code in the active file.
Send Push Message Select to parse out a Push Message from the current source code.

Advanced

Select Edit > Advanced to open the Advanced Edit Options sub-menu:

Advanced Edit Sub-Menu Options
Action Description
Make Selection Uppercase With text selected in an Editor window, select this option to change all selected characters to uppercase.
Make Selection Lowercase With text selected in an Editor window, select this option to change all selected characters to lowercase.
Invert Case With text selected in an Editor window, select this option to invert the case for all selected characters.
Renumber Selection With text selected in an Editor window, select this option to re-arrange the selected text to make all numbers in the code (i.e. device numbers, channel numbers, etc) fall into ascending sequential order.
Block Comment- Uncomment With one or more lines of text selected in an Editor window, select this option to toggle the selected code to and from being a comment (by inserting two forward slashes at the beginning of the line containing the cursor).
Find Matching Brace With the cursor on one brace in an Editor window, select this option to move the cursor to the other (matching) brace in the set.
Show Whitespace Select this option to display dots in the Editor window to indicate "whitespaces" (spaces and tabs) in the code. By default, this option is disabled.
Show End of Line Select this option to toggle the display of the end of each line of code (indicated by the characters "CRLF"). The CRLF text displayed on the screen is the inverse of the color associated with the "Space" character that is defined in the Preference dialog. By default, this option is disabled.
Rescan Current Source File Select this option to rescan the active Source Code file, in order to rebuild the symbol information utilized by the
Code Wizard Select this option to launch the Code Wizard. The Code Wizard presents a series of dialogs that help you quickly generate various types of NetLinx code segments. See

Using the Code Wizard on page 88

for details. | | Unicode Edit | Select this option to edit in Unicode. See

Working with Unicode on page 100

for details. | | Clipboard Buffers | Select this option to access a listing of the contents of the clipboard text buffer. Use this option to copy multiple selections from the Source to clipboard memory as separate items that you can selectively paste from the clipboard. |

NOTE: None of these commands have default keyboard hotkeys assigned. To assign hotkeys, use the Keyboard tab of the Customize dialog (select Advanced Editor from the Category drop-down list).

Macros

Select Edit > Macros to open the Macros sub-menu. Use the options in this menu to create and manage macros for use in Editor windows. Alternatively, use the toolbar buttons in the Macros toolbar to access these functions.

    • NetLinx Studio Macros Files use the file extension *.NSM.
    • See the

      Working with Macros section on page 104

      for details.

Expand / Collapse All Fold Levels

Fold levels can be used to simplify the view in the Editor windows by allowing you to "fold" each major section of the code so that only the header row is visible. This way, you only see the section(s) that you are actually working in. Fold levels can be collapsed and expanded, in much the same way as the tree structures that occur in the Workspace Bar.

    • Fold levels that are collapsed are indicated by a blue plus sign (+) to the left of the line containing that section's header row.
    • Fold levels that are expanded are indicated by a red minus sign (-) to the left of the line containing that section's header row.

FIG. 160 Code Folding

To use fold levels, you must first select the Enable Code Folding option in the Editor - Display and Indentions tab of the Preferences

dialog (by default, this option is disabled).

FIG. 161 Preferences dialog - Cold Folding Enabled

    • If the Enable Code Folding option has not been enabled, these two options are unavailable.
    • Also note that the application will remember your last code folding settings when the file is closed, so they will still be in place the next you open the file.

results matching ""

    No results matching ""