Development Environment | ![]() ![]() |
Appearance of an M-File
The following appearance features make M-files more readable.
You can specify the default behavior for many of them - see Preferences for the Editor/Debugger.
Syntax Highlighting
Some entries appear in different colors to help you better find matching elements, such as if/else
statements. For more information, see Syntax Highlighting.
In addition to syntax highlighting, when you type a closing delimiter, that is, a right ), ], or }, its matching opening delimiter is briefly highlighted.
Indenting
Flow control entries are automatically indented to aid in reading the loops, such as while
/end
statements.
To move the current or selected lines further to the left, select Decrease Indent from the Text menu. To move the current or selected lines further to the right, select Increase Indent from the Text menu. If after using these features you want to apply automatic indenting to selected lines, select Smart Indent from the Text menu, or right-click and select it from the context menu. For more information about smart indenting, see the preference for smart indent.
Commenting
You can comment the current line or a selection of lines. To quickly select a line, click just to the left of the line - the line becomes highlighted. Drag or shift-click to select multiple lines. Then select Comment from the Text menu, or right-click and select it from the context menu. A comment symbol, %, is added at the start of the line, and the color of the text becomes green.
You can also uncomment a selected group of lines - select Uncomment from the Text menu, or right-click and select it from the context menu.
Showing Balanced Delimiters
When you position the cursor inside a pair of delimiters, that is, inside ( ), [ ], or { }, and select Balance Delimiters from the Text menu, the string inside the pair of delimiters is highlighted. In this example, when the cursor is positioned before /norm
, as indicated here
selecting Balance Delimiters highlights the selection as shown here.
![]() | Creating and Editing M-Files with the Editor/Debugger | Navigating in an M-File | ![]() |