2.2.2.1 Data Type by Specification

Type declaration statements explicitly specify the data type of variables. For example, the following statements associate VAR1 with an 8-byte complex-data storage location, and VAR2 with an 8-byte double-precision storage location:

COMPLEX VAR1
DOUBLE PRECISION VAR2

You can explicitly specify the data type of a variable only once.

An explicit data type specification takes precedence over the type specified by an IMPLICIT statement. The data type specified by an IMPLICIT statement is associated with a variable only when an explicit specification is absent. In this case, any variable with a name that begins with the letter in the range specified in the IMPLICIT statement becomes the data type of the variable.

Character type declaration statements specify that given variables represent character values with the length specified. For example, the following statements associate the variable names INLINE, NAME, and NUMBER with storage locations containing character data of lengths 72, 12, and 9, respectively:

CHARACTER*72 INLINE
CHARACTER NAME*12, NUMBER*9

In single subprograms, passed-length character arguments process character strings with different lengths. The passed-length character argument has a length specification of asterisk (*); for example:

CHARACTER*(*) CHARDUMMY

The passed-length character argument assumes the length of the actual argument.

For More Information:


Previous Page Next Page Table of Contents