Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Controlling indention z/OS UNIX System Services User's Guide SA23-2279-00 |
|
The source code for a program differs from ordinary text in a number of ways. One of the most important of these is the way in which source code uses indention. Indention shows the logical structure of the program: the way in which statements are grouped into blocks. Issue the command:
(Don't forget to press<Enter>after
you have typed this.) This command turns on an option supplied primarily
to control indention when entering source code. Each line is automatically
indented the same distance as the previous one. As a programmer,
you will find this saves you quite a bit of work getting the indention
right, especially when you have several levels of indention.When you are entering code with autoindent enabled, typing <EscChar-T> gives
you another level of indention, and typing <EscChar-D>takes one away. While
you are in Insert Mode (not Command Mode):
Try using the autoindent option when you are entering source code. It simplifies the job of getting indention correct. It can even sometimes help you avoid bugs; for example, in C source code, you usually need one closing } for every level of indention you go backwards. The << and >> commands are also helpful
when indenting source code:
You can shift a number of lines by typing the number followed by >> or <<. For example, typing 5>> will indent five lines, including the line the cursor is on. The default shift is 8 spaces (right or left). You can change this
default with this command:
Tip: It is convenient to have a shiftwidth that is the same size as the width between tab stops. |
Copyright IBM Corporation 1990, 2014
|