Copyright ã1996 by NeXT Software, Inc.  All Rights Reserved.

;NavigatingWithinCode.rtfd;;¬  Next Section	;CheckingDelimiters.rtfd;;¬  Previous Section

Indenting code

¬	To customize automatic code indentation, choose Preferences from the Info menu and select the desired Indentation preferences.

¬	To indent a line of code, click anywhere in the line and choose Edit ¬ Indentation¬ Indent.

¬	To force indentation left or right, select code and then chose Shift Left or Shift Right from the Indentation menu.

¬	To format messages with many arguments, choose Expand Message Expression from the Indentation menu.

One of the more tedious tasks programmers must do is indenting code: aligning statements and blocks of code with the same scope on the same tab stop. Project Builder alleviates much of this tedium by providing options for both automatic and manual indentation.

In the Indentation preferences display, you can tell the code editor when to indent each line of code based on the final character of the previous line. You can also specify how many spaces lines should be indented, based on certain conditions.

¬

Tip: The Key Bindings preference display has options related to using the Tab key for indentation: ªIndent only at beginning of lineº and ªIndent always.º Use the second option if you want to use Tab to indent a line when the cursor is anywhere in that line.

For both single lines and ranges of lines, you can you can issue commands to indent according to the indentation characteristics specified in Preferences; or you can give commands to force a certain indentation.

¬
Messages with multiple arguments can be hard to read. Project Builder gives you a command on the Indentation menu with which to format them.

¬
To return a formatted message expression to an unformatted message expression (in other words, reverse the sequence in the above example), select the expression and choose Edit ¬ Indentation ¬ Compress Whitespace.