fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Ref Manual Home |

VALUE

Syntax:

!% VALUE [:] [:] <symbol> [ , <symbol> ... ]

Function:

This command is written as a comment in the Fortran code. It specifies that the named sub-program arguments are passed by value. fpt uses this information in the argument consistency check (please see CHECK ARGUMENTS).

The command is usually used to specify the argument passing protocol to external routines written in C, C++ or another language. Note that the fpt VALUE command is NOT equivalent to the standard Fortran VALUE attribute. The fpt VALUE command specifies that the value of the named argument will be passed directly to the called routine, usually on the stack. The Fortran VALUE attribute specifies that a copy of the argument will be passed by reference to the called routine. Usually the address of the copy will be placed on the stack.

The alternative protocol specifications for arguments are:

!% VALUE

!% REFERENCE

!% DESCRIPTOR

!% STRING

The VALUE command must be written in code within the scope of declaration of the variable. It is introduced by a comment delimiter in column 1 and the character % in column 2.

Argument names which contain exotic characters such as '%', ':' or '#' (which are all legal on some systems) must be written as quoted strings.

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

By reference for numeric arguments, and as specified by the command % PASS STRING ARGUMENTS for arguments of type character.

Example

SUBROUTINE HSD_OUT(ARR,ICOUNT) REAL*4 ARR(*) ! Output data INTEGER*4 ICOUNT ! Number of elements !% VALUE :: ICOUNT

See Also

CHECK ARGUMENTS

PASS STRING ARGUMENTS

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