Article View: net.lang.f77
Article #303Re: Question on "Parameter" statement
From: Donn Seeley
Date: Wed, 29 Jan 1986 06:22
Date: Wed, 29 Jan 1986 06:22
30 lines
1649 bytes
1649 bytes
Peter Shenkin asks why
parameter (size = 10)
character*size string
doesn't work. The problem probably seems straightforward to those who
have programmed in antique Fortrans... It is perhaps more obvious if
one uses antique style:
PARAMETER(SIZE=10)
CHARACTER*SIZESTRING
White space is not significant in Fortran, so SIZESTRING appears as one
token to the Fortran compiler. This is obviously a syntax error since
SIZESTRING is not defined and in any case no variable is being declared
by the type statement. What was intended was probably:
parameter (size = 10)
character*(size) string
My reading of the standard indicates that only integer constants (and
not symbolic names of integer constants) may appear naked as length
specifications; all other integer constant expressions must appear
enclosed in parentheses (Section 8.4.2, ANSI X3.9-1978). This
conveniently rules out the tokenizing difficulty described here...
ISNTFORTRANWONDERFUL,
Donn Seeley University of Utah CS Dept donn@utah-cs.arpa
40 46' 6"N 111 50' 34"W (801) 581-5668 decvax!utah-cs!donn
Technical Details
Message-ID:
<3651@utah-cs.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!utah-cs!donnReferences:
<410@cubsvax.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!utah-cs!donn From: donn@utah-cs.UUCP (Donn Seeley) Newsgroups: net.lang.f77 Subject: Re: Question on "Parameter" statement Message-ID: <3651@utah-cs.UUCP> Date: Wed, 29-Jan-86 01:22:58 EST Article-I.D.: utah-cs.3651 Posted: Wed Jan 29 01:22:58 1986 Date-Received: Fri, 31-Jan-86 23:54:59 EST References: <410@cubsvax.UUCP> Organization: University of Utah CS Dept Lines: 30