FORM - format a free format Fortran program.

Syntax:

form infile outfile [options]*
StartstatemenT=nn        IncrementstatemenT=mm
StartFormat=nn           IncrementFormat=mm
StartseQuence=nn         IncrementseQuence=mm
(+|-)Fold (-)            (+|-)Indent (-)
(+|-)Warning (+)

Examples:

form /freeform fixform
form /freeform fixform st=1000 it=10 +warning
form /freeform fixform sq=10000 iq=5
form /freeform fixform st=1000 sf=9000 +in +fld +wrn

Options:

StartstatemenT=nn
starts the numbering of statements with number "nn". The default is 1.
IncrementstatemenT=mm
sets the increment for statement numbering to "mm". The default is 1. If "ST=nn" is not specified but "IT=mm" is, "ST=mm" is assumed.
StartFormat=nn
starts numbering FORMAT statements with number "nn". The default is to have FORMAT statements sequenced along with other statements having statement numbers.
IncrementFormat=mm
sets increment for FORMAT numbering to "mm". The default is 1. If "SF=nn" is not specified but "IF=mm" is, "SF=mm" is assumed.
StartseQuence=nn
inserts sequence numbers in columns 73 to 80, starting at "nn". The default is for no sequence numbers to appear. Presumably this would be of interest only if you were going to punch a deck of cards. Sequence numbers will be left-filled with zeroes.
IncrementseQuence=mm
sets the increment for sequence numbers in columns 73 to 80 to "mm". If "SQ=nn" is not specified but "IQ=mm" is, "SQ=mm" is assumed.
+Indent
suitably indents do-loops.
+Fold
folds lines greater than 72 characters.
-Warning
suppresses warning messages regarding quotes and parentheses.

Description:

FORM uses a two-pass process to accept a free format Fortran program and format it with statement numbers right-justified in columns 1-5, comment markers in column 1, continuation markers in column 6, program text in columns 7-72, and, if requested, sequence numbers in columns 73-80. The program tests the "first" card of input in the following manner:

If line numbers are present according to the above test, they are stripped off. If the line number is followed immediately by a "#", the "#" is also stripped off. Lines beginning with a "##", a "$", a "C", or a "*" (comment or control cards) are not reformatted but are folded and continuation from position 73 occurs. (Note: this may cause unsightly comments if one of the lines exceeds 72 characters and subsequent lines are indented by more than 2 or 3 spaces).

If the input and output file names are the same, the input file is copied to the temporary file ".form" and is left in the AFT. The formatted program is not transferred to the output file until all action is complete.

FORM renumbers statements in each routine (or function) using the start and increment numbers specified either explicitly or by default. If no matching statement number is encountered in the current routine or function during conversion of an appropriate number within a statement, the number is converted to zero for identification and debug.

DO loop indentation:

If +Indent is specified, FORM indents "DO loops" in the following manner:

  1. 1-5 nested loops; indent two spaces for each loop.
  2. 6-10 nested loops; indent an additional space for each level.
  3. No further indenting occurs beyond 10 nested loops.

Warning option:

The +Warning option attempts to identify lines that have unbalanced parentheses or quotation marks. When a line with such a problem is identified, a message is directed to the terminal, giving the number of the line that has been identified.

Known Bugs:

A number of bugs have been identified in this program. Some of them are listed in "expl form bugs".

Files Used:

.form
.form1.
.form2.

Copyright © 1996, Thinkage Ltd.