FPT and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Reference Manual Home |


SPACE

Syntax:

[NO] SPACE { BEFORE | AFTER }
    {  KEYWORDS           |  OPERATORS          |  INTRINSICS         |  NUMBERS            |  HEX                | 
       LABELS             |  COMMAS             |  CONTINUATIONS      |  TRAILING COMMENTS  |  FORMAT TOKENS      | 
       <specific keyword> | <specific operator or delimiter> }

NO SPACES

Specific operators must be enclosed in string delimiters. Specific keywords may 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, unless the previous character is already a space or tab.

  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, or before or after the underscore delimiter which separates a literal value from its Fortran 90 kind descriptor unless the space is explicitly requested by the the SPACE BEFORE COMMA, SPACE BEFORE ",", SPACE BEFORE "_" or SPACE AFTER "_" command. Note that most compilers require that no spaces are written between a literal value and a kind specifier.

The spacing is specified by the commands:

SPACE BEFORE <token>

NO SPACE BEFORE <token>

SPACE AFTER <token>

NO SPACE AFTER <token>

NO SPACES

The token may be:

Note that the NO SPACE BEFORE and NO SPACE AFTER commands do not remove spaces if these are required after the preceding token or before the next one. Please also note the special status of commas and underscore delimiters.

The NO SPACES command removes all unnecessary spaces.

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

Example formats are distributed in the files spaced.fsp and compact.fsp in the main FPT directory.

Where to use this command:

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

Yes


Default:

NO SPACES

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

See also:

SHOW FORMAT


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