[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


Balancing Punctuation

When you edit source code, you often have to make sure that every opening parenthesis (, bracket [, and brace { has a closing parenthesis ), bracket ], and brace }, or the compiler could misinterpret your code or give you an error.

The CodeWarrior IDE provides several checks that help you balance these elements correctly.

To check for balanced parentheses, brackets, or braces, place the insertion point in the text you want to check. Then, choose Balance from the Edit Menu. Alternatively, double-click on the parenthesis, bracket, or brace character that you want to check for a matching character.

The CodeWarrior editor searches through the text file, starting from the text-insertion point, for a parenthesis, bracket, or brace. After the editor finds one of these characters, it searches through the text file in the opposite direction for a matching character. When the editor finds a match, it selects the text between the two characters. The computer beeps when the punctuation is not balanced. For example, if the insertion point is not enclosed by matching parentheses, brackets, or braces, the computer beeps.


TIP

Use the Balance command to quickly select blocks of code.

Using automatic balancing

You can have the editor check for balanced punctuation automatically. To learn more about this feature, refer to "Balance while typing."


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 17, 2000