Thanks to the contributors to this thread - there are a few format settings which we don’t (yet) have in fpt - for example, squashing multiple blank lines.
Everyone is welcome to use the fpt formatting commands to look at trial formats. To give a feeling for what is available, here is the format script for our in house style. You can find documentation for the commands at http://simconglobal.com .
!H!****************************************************************************
!H! File: saved_format.fsp
!H! Output by fpt 4.2-l Intel-Linux On 31:Dec:50 At 00:00:00
!H!****************************************************************************
! Free / Fixed / Tab format
%SET FILE LAYOUTS
%FREE FORMAT OUTPUT
%OUTPUT CODE LINE LENGTH: 132
! Indentation
%DO NOT INDENT HEADER COMMENTS
%INDENT COMMENTS
%INDENT SUB-PROGRAM CODE BY: 8 COLUMNS
%INDENT EACH LEVEL OF NESTING BY: 3 COLUMNS
%MAXIMUM INDENTATION NESTING LEVEL: 8
%INDENT LABELS BY: 0 COLUMNS
%INDENT CONTINUATION LINES BY: 1 COLUMNS
! Continuation lines
%WRITE CONTINUATION CHARACTER IN COLUMN: 88
%CONTINUATION CHARACTER :"1"
%KEEP CONTINUATION LINES
! Upper or lower case
%UPPER CASE KEYWORDS
%LOWER CASE SYMBOLS
%DEFAULT CASE PARAMETERS
%UPPER CASE INTRINSICS
%UPPER CASE OPERATORS
%LOWER CASE FILE NAMES
! Spacing before symbols, intrinsics, numbers etc.
%NO SPACE BEFORE SYMBOLS
%NO SPACE BEFORE INTRINSICS
%NO SPACE BEFORE NUMBERS
%NO SPACE BEFORE OCTALS
%NO SPACE BEFORE LABELS
%NO SPACE BEFORE STRINGS
%NO SPACE BEFORE FORMAT TOKENS
%NO SPACE BEFORE TRAILING COMMENTS
! Spacing after symbols, intrinsics, numbers etc.
%NO SPACE AFTER SYMBOLS
%NO SPACE AFTER INTRINSICS
%NO SPACE AFTER NUMBERS
%NO SPACE AFTER OCTALS
%NO SPACE AFTER LABELS
%NO SPACE AFTER STRINGS
%NO SPACE AFTER FORMAT TOKENS
%SPACE AFTER CONTINUATIONS
! Spacing before keywords
%NO SPACE BEFORE KEYWORDS
%SPACE BEFORE "FUNCTION"
%SPACE BEFORE "CALL"
%SPACE BEFORE "GO"
%SPACE BEFORE "GOTO"
%SPACE BEFORE "PAUSE"
%SPACE BEFORE "RETURN"
%SPACE BEFORE "STOP"
%SPACE BEFORE "ASSIGN"
! Spacing before auxiliary keywords
%SPACE BEFORE "THEN"
! Spacing after keywords
%NO SPACE AFTER KEYWORDS
%SPACE AFTER "PARAMETER"
%SPACE AFTER "COMMON"
%SPACE AFTER "STRUCTURE"
%SPACE AFTER "RECORD"
%SPACE AFTER "EQUIVALENCE"
%SPACE AFTER "DATA"
%SPACE AFTER "NAMELIST"
%SPACE AFTER "WHILE"
%SPACE AFTER "ELSEIF"
%SPACE AFTER "END"
%SPACE AFTER "GOTO"
%SPACE AFTER "IF"
%SPACE AFTER "PAUSE"
%SPACE AFTER "RETURN"
%SPACE AFTER "STOP"
%SPACE AFTER "ACCEPT"
%SPACE AFTER "ENCODE"
%SPACE AFTER "DECODE"
%SPACE AFTER "PRINT"
%SPACE AFTER "READ"
%SPACE AFTER "TYPE"
%SPACE AFTER "WRITE"
%SPACE AFTER "BACKSPACE"
%SPACE AFTER "CLOSE"
%SPACE AFTER "DELETE"
%SPACE AFTER "ENDFILE"
%SPACE AFTER "INQUIRE"
%SPACE AFTER "OPEN"
%SPACE AFTER "REWIND"
%SPACE AFTER "UNLOCK"
%SPACE AFTER "OPTIONS"
%SPACE AFTER "FORMAT"
! Spacing after auxiliary keywords
%SPACE AFTER "TYPE"
%SPACE AFTER "END"
%SPACE AFTER "OPEN"
! Spacing before operators
%NO SPACE BEFORE OPERATORS
%SPACE BEFORE ".AND."
%SPACE BEFORE ".EQ."
%SPACE BEFORE ".EQV."
%SPACE BEFORE ".GE."
%SPACE BEFORE ".GT."
%SPACE BEFORE ".LE."
%SPACE BEFORE ".LT."
%SPACE BEFORE ".NE."
%SPACE BEFORE ".NEQV."
%SPACE BEFORE ".OR."
%SPACE BEFORE ".XOR."
%SPACE BEFORE ".IAND."
%SPACE BEFORE ".IOR."
%SPACE BEFORE ".IEOR."
%SPACE BEFORE ".IMOD."
%SPACE BEFORE ".ISHFT."
%SPACE BEFORE "::"
! Spacing after operators
%NO SPACE AFTER OPERATORS
%SPACE AFTER ".AND."
%SPACE AFTER ".EQ."
%SPACE AFTER ".EQV."
%SPACE AFTER ".GE."
%SPACE AFTER ".GT."
%SPACE AFTER ".LE."
%SPACE AFTER ".LT."
%SPACE AFTER ".NE."
%SPACE AFTER ".NEQV."
%SPACE AFTER ".NOT."
%SPACE AFTER ".OR."
%SPACE AFTER ".XOR."
%SPACE AFTER ".IAND."
%SPACE AFTER ".IOR."
%SPACE AFTER ".IEOR."
%SPACE AFTER ".IMOD."
%SPACE AFTER ".ISHFT."
%SPACE AFTER "::"
! Real numbers
%COMPLETE REAL NUMBERS
! Hex and Octal numbers
%DO NOT CHANGE HEX NUMBERS
%DO NOT CHANGE OCTAL NUMBERS
! Column format
%NO COLUMN FORMAT DECLARATIONS
%NO COLUMN FORMAT CONDITIONALS
! Comments and sentinels
%TRAILING COMMENTS
%DO NOT CHANGE COMMENT DELIMITER
%KEEP OPTIONAL COMMENT DELIMITERS
%DO NOT RECOGNISE TEXT SEPARATOR COMMENTS
! Tabs within code and before comments
%KEEP EMBEDDED TABS
! Special characters
%DO NOT TRANSLATE HIGH VALUED CHARACTERS IN COMMENTS
%DO NOT TRANSLATE HIGH VALUED CHARACTERS IN STRINGS
! Special cases
%DO NOT WRITE STOP STATEMENTS ON ONE LINE
! End of saved_format.fsp
You can run fpt on a test code interactively, use the formatting commands and type the code to see what it looks like. You can then save the format with the “% save format ” command. If you do this, use the %window command to set a llarge number of lines to be displayed.