Example Command File [ HP FORTRAN 77/iX Migration Guide ] MPE/iX 5.0 Documentation
HP FORTRAN 77/iX Migration Guide
Example Command File
Here is an example of a command file, with comments explaining what it
does.
* This file converts free format to fixed format FORTRAN.
*
* If the string "$CONTROL FREE" is found, delete that line:
D/$CONTROL FREE/
* If a line begins with a series of alphanumeric characters,
* followed by a space, delete them (or, if the line begins with just
* a space, delete the space). This removes blank spaces in column 1
* of the FORTRAN 66/V line numbers and deletes the
* "sequence fields," which have no counterpart
* in HP FORTRAN 77/V.
R/^[a-zA-Z0-9]* ///
* If a line begins with a #, replace it with a C.
N/^\#//C/
* If a line begins with one or more digits followed by a space,
* move everything that follows the space to the right of
* column 7. This moves all statements preceded by statement
* numbers from whatever column they are in to column 7.
R/^[0-9]+ //&^7/
* If a line begins with anything other than a digit or a dollar
* sign, move that to the right of column 7. This moves all
* statements, except compiler options and statements with
* statement numbers, to column 7.
R/^[^0-9$]//^7&/
* The T and S commands are used in this order to "remember" that
* an & was found on the previous line and to put it on the next line.
* This produces the FORTRAN 66/V construct of an ampersand at the end
* of a line indicating a continuation line to conform to the HP FORTRAN 77/V
* construct of a character in column 6 indicating a continuation line.
T/^6 //\&/
S/\&$///
MPE/iX 5.0 Documentation