Indenting Lines of Code

·To indent lines:

1.Go to the statement where you want to indent text (on line 41). Press ALT+A, type 41, then press CTRL+M to jump to line 41.

This sequence of keystrokes is pronounced “Arg 41 Mark.” The PWB function Arg begins an argument (41) that is passed to the Mark function. When you pass a number to Mark, PWB moves the cursor to that line.

You can also do this from the menu by typing the line number in the Goto Mark dialog box from the Search menu.

2.Move the cursor to the double quotation mark (") in column 5.

3.Hold down the SHIFT key and press the RIGHT ARROW key eight times so that the cursor is in column 13, under the opening double quotation mark in the printf statement.

4.Press SHIFT+DOWN eight times to select the rest of the statement.

By default, the editor starts in stream selection mode. This mode allows selection to begin at any point and selects all characters in a stream between the beginning and end of a selection, as shown above. You will need to change the selection mode to perform the block indent.

The Edit menu lets you choose from three selection modes:

Stream mode. The default, as explained previously.

Line mode allows you to select complete lines of text.

Box mode allows you to select a rectangular section of text.

When the starting column of the selection is the same as the ending column, PWB selects the range of lines, just as it does for line selection mode.Choose Box Mode from the Edit menu. Your screen should look like the preceding picture.Press CTRL+N to indent the lines.

Pressing CTRL+N executes the Linsert function. When you have a box selected, Linsert inserts spaces into the selected area. With no selection, Linsert inserts a line above the cursor.

Now the printf format string and arguments are neatly aligned.