fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Ref Manual Home |

SPACE BEFORE/AFTER

Syntax:

[NO] SPACE BEFORE <token> [NO] SPACE AFTER <token> NO SPACES

where <token> may be:

Spacing may be specified separately for individual operators and keywords. When a specific operator is specified the operator must be enclosed in string delimiters. Specific keywords may but need not be enclosed in string delimiters.

Function:

The SPACE BEFORE, SPACE AFTER and NO SPACES commands control the spacing of the Fortran code written by fpt. fpt writes one space character between two consecutive tokens on the same line according to the following rules:

  1. A space is always written between two tokens if the first ends with a number or letter and the second begins with a number or letter.
  2. A space is written after a token if SPACE AFTER has been specified for that token.
  3. A space is written before a token if SPACE BEFORE has been specified for that token.
  4. fpt does not insert two spaces if a space is required after the first token and before the second.
  5. fpt does not write a space after the last token on a line.
  6. A continuation line is generated automatically if the code extends past the printer column for the current code line length. The printer column is computed with the assumption that tabs transfer printing to the next tab stop, at 8 character intervals.
  7. If a line is occupied by a single very long token, such as a character string or Hollerith constant, a space is not inserted between a continuation character and that token if this would push the end of the token into the fixed format Fortran comment field beyond the current code line length, or if it would exceed the maximum free format line length.
  8. A space is not inserted before a comma unless the space is explicitly requested by the the SPACE BEFORE COMMA command.
  9. Spaces are not inserted around the underscore delimiter which separates a literal value from its Fortran 90 kind specifier. Note that most compilers require this.

The SHOW FORMAT command is used interactively to display the current format settings.

Examples

formats are distributed in the files free_format.fsp, spaced.fsp and compact.fsp in the main fpt directory.

Where to Use these Commands

Operating system command line Yes
Configuration file, config.fsp Yes
Specification (fsp) files, *.fsp Yes
Interactively, to FPT> prompt Yes
Interactive command files Yes
Embedded in the Fortran code No

Default

NO SPACES

(Note that defaults may be changed in the configuration file)

See Also

SHOW FORMAT

Copyright ©1995 to 2025 Software Validation Ltd. All rights reserved.