FPT and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Reference Manual Home |


INTENT

Syntax:

!% INTENT [(] { IN | OUT | IN OUT | INOUT } [)] [:][:] <symbol> [ , <symbol> ... ]

!% INTENT [(] { IN | OUT | IN OUT | INOUT } [)] [:][:] <string> [ , <string> ... ]


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 directiver !% 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 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.

Example:

! File: SECNDS.FTM 25-Jun-98 Brian Farrimond REAL*4 FUNCTION secnds(t) REAL*4 t ! Time to subtract !% INTENT (IN) :: t

See also:

CHECK ARGUMENTS

CHECK USAGE


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