1.5.2 Tab-Format Lines

You can use tab formatting to specify a statement label field, a continuation indicator field, and a statement field, but not a sequence number field.

Figure 1-2 shows equivalent Fortran lines first coded with tab formatting, then with fixed formatting.

Figure 1-2 Line Formatting Example

The statement label field consists of the characters that you type before the first tab character. The statement label field cannot have more than five characters.

After entering the first tab character, you can type either the continuation indicator field or the statement field.

To enter the continuation indicator field, type any nonzero digit after the first tab. If you enter the continuation indicator field, the statement field consists of all the characters after the digit to the end of the line.

To enter the statement field without a continuation indicator field, type the statement immediately after the first tab. A Fortran statement cannot start with a digit.

Many text editors and terminals advance the terminal print carriage to a predefined print position when you press the TAB key. However, this action is not the Compaq Fortran 77 compiler's interpretation of the tab character. The compiler treats the tab character in a statement field the same way as it treats a space. In the source listing that the compiler produces, the tab causes the character that follows to be printed at the next tab stop (located at columns 9, 17, 25, 33, and so on).


Note
Do not use tabs to position sequence numbers, or the compiler may interpret the sequence numbers as part of the statement fields in your program.


Previous Page Next Page Table of Contents