FPT and WinFPT Reference Manual - Command-line Commands
| SimCon Home | Reference Manual Home |
Syntax:
[NO] SPACE { BEFORE | AFTER }
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:
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.
A space is written after a token if SPACE AFTER has been specified for that token.
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.
FPT does not insert two spaces if a space is required after the first token and before the second.
FPT does not write a space after the last token on a line.
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.
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.
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:
KEYWORDS All Fortran keywords such as GOTO, DO, INTEGER;
OPERATORS All operators and delimiters except comma and underscore, e.g. +,-,* and also .AND., .EQ. etc.
INTRINSICS All intrinsic function names such as MAX, SIN, COS;
SYMBOLS User-defined symbols such as variable names, sub-program names and control construct tags;
NUMBERS Integer or real numbers;
HEX Hexadecimal and octal numbers;
OCTALS Hexadecimal and octal numbers;
LABELS Statement labels within the body of a statement;
COMMAS The comma character;
STRINGS Delimited character strings;
TRAILING COMMENTS Trailing comments delimited by ! or /*;
CONTINUATIONS Continuation characters;
Specific keywords Such as FUNCTION, THEN, GOTO etc.
Specific operators Such as +, **, .NE. (which must be enclosed in quotes);
FORMAT TOKENS For example, the I and F tokens in FORMAT(I5,F12.4).
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:
Copyright ©1995 to 2014 Software Validation Ltd. All rights reserved.