24.11.2014 Views

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Language</strong> <strong>Reference</strong><br />

2.64 PARAMETER Statement<br />

<br />

PARAMETER (p=e [,p=e] ...)<br />

where:<br />

p<br />

e<br />

is a symbolic name.<br />

is a constant expression. Refer to the chapter entitled "Expressions" on page 173 for more<br />

information.<br />

p is known as a symbolic constant whose value is determined by the value of the expression e according to<br />

the rules of assignment as described in the chapter entitled "Assignment Statements" on page 187. Any<br />

symbolic constant appearing in expression e must have been previously defined in the same or a previous<br />

PARAMETER statement in the same program unit. A symbolic constant may not be defined more than once<br />

in a program unit.<br />

If the symbolic name p is of type integer, real, double precision or complex then the corresponding<br />

expression e must be an arithmetic constant expression (see the chapter entitled "Expressions" on page<br />

173). If the symbolic name p is of type character or logical then the expression e must be a character<br />

constant expression or a logical constant expression respectively (see the chapter entitled "Expressions" on<br />

page 173).<br />

Example:<br />

PARAMETER (PI=3.14159,BUFFER=80,PIBY2=PI/2)<br />

PARAMETER (ERRMSG=’AN ERROR HAS OCCURRED’)<br />

If a symbolic constant is not of default implied type, its type must be specified in an IMPLICIT statement<br />

or a type statement before its occurrence in a PARAMETER statement. Similarly, if the length of a character<br />

symbolic constant is not the default length of 1, its length must be specified in an IMPLICIT statement or<br />

a type statement before its occurrence in a PARAMETER statement.<br />

116 PARAMETER Statement

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!