fpt and WinFPT Reference Manual - Command-line Commands
| SimCon Home | Ref Manual Home |
INTENT
Syntax:
!% INTENT [(] { IN | OUT | IN OUT | INOUT } [)] [:][:] <symbol> [ , <symbol> ... ]
Function:
Specifies that the named sub-program arguments are inputs to, outputs from, or both inputs to and outputs of their sub-program. fpt uses this information in the argument consistency check and in the usage check (please see CHECK ARGUMENTS and CHECK USAGE). fpt also checks the code of the sub-program to confirm that an input argument is never written to, and that an output argument is not read before it is written to. A diagnostic message is generated if either condition is violated.
Names which contain exotic characters such as '%', ':' or '#' (which are all legal on some systems) must be written as quoted strings.
fpt carries out the same analyses when the Fortran keyword INTENT is used instead of the directive !% INTENT and it is not necessary to specify both. The fpt directive is invisible to the Fortran compiler and may be used when the code is compiled with FORTRAN 77 compilers which do not support the INTENT keyword.
The % INTENT command must be written in code within the scope of declaration of the variable.
The command may be used in Fortran template files (ftm files) to specify the access required for arguments when the sub-program code is not available.
Where to Use this Command
Operating system command line | No |
Configuration file, config.fsp | No |
Specification (fsp) files, *.fsp | No |
Interactively, to FPT> prompt | No |
Interactive command files | No |
Embedded in the Fortran code | Yes |
Default
The status of each argument is inferred from the code.
Examples
! File: SECNDS.FTM 25-Jun-98 Brian Farrimond REAL*4 FUNCTION secnds(t) REAL*4 t ! Time to subtract !% INTENT (IN) :: t
See Also
Copyright ©1995 to 2024 Software Validation Ltd. All rights reserved.