[Next] [Up] [Previous]

The IMPLICIT Statement

The IMPLICIT statement has the form

       IMPLICIT (type)range,range,...;range,range,...;(type)range,range,...;...

where range is one or more letters, optionally followed by : and one or more letters.

The first set of ranges, separated by commas, and terminated by semicolons, refers to the beginning of a variable name; the second, to the end of the name.

Earlier type designations within an IMPLICIT statement have priority.

The IMPLICIT statement establishes a rule for the assignment of undeclared variables to types to replace the normal rule that variables starting with a letter from I through N are INTEGER, all others being REAL.

Only one IMPLICIT statement may appear in a program. It must appear before any executable statement in that program.

This allows user-defined types to be used in an IMPLICIT statement, as would not be possible if it were required to be the very first statement of a program, as in FORTRAN.

As an example, the IMPLICIT statement


will cause all undeclared variables whose names end in R to be REAL, and all other variables are also REAL unless their names start with a letter from A through N.

Note that the syntax is considerably different from that of FORTRAN's IMPLICIT statement.

[Next] [Up] [Previous]