Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
E77790.pdf
Скачиваний:
2
Добавлен:
16.05.2024
Размер:
1.29 Mб
Скачать

4.1Source Language Features

If a tab is the first nonblank character, then:

If the character after the tab is anything other than a nonzero digit, then the text following the tab is an initial line.

If there is a nonzero digit after the first tab, the line is a continuation line. The text following the nonzero digit is the next part of the statement.

The f95 default maximum line length is 72 columns for fixed form and 250 for free form. Use the -e compiler option to extend the lines in fixed-format source to 250 columns.

Example: The tab form source on the left is treated as shown on the right.

!^IUses of tabs

!

Uses of tabs

^ICHARACTER *3 A = ’A’

 

CHARACTER *3 A = ’A’

^IINTEGER B = 2

 

INTEGER B = 2

^IREAL C = 3.0

 

REAL C = 3.0

^IWRITE(*,9) A, B, C

 

WRITE(*,9) A, B, C

9^IFORMAT(1X, A3,

9

FORMAT(1X, A3,

^I1 I3,

1

I3,

^I2 F9.1 )

2

F9.1 )

^IEND

 

END

In the example above, ”^I” stands for the tab character, and the line starting with “1” and “2” are continuation lines. The coding is shown to illustrate various tab situations, and not to advocate any one style.

Tabs in f95 force the rest of the line to be padded out to column 72. This may cause unexpected results if the tab appears within a character string that is continued onto the next line:

Source file:

^Iprint *, "Tab on next line

^I1this continuation line starts with a tab." ^Iend

Running the code:

Tab on next line

this continuation

line starts with a tab.

 

When tab formatting is used with the —f77 option, there is no 250 character limit to the line length. The line can be much longer.

4.1.4Source Form Assumed

The source form assumed by f95 depends on options, directives, and suffixes.

168 Oracle Developer Studio 12.6: Fortran User's Guide • July 2017

Соседние файлы в предмете Информационные и сетевые технологии