Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Q: Fortran statement function problem
@ 1994-07-26 22:31 Peyton Bland
  1994-07-27  6:54 ` system PRIVILEGED account
  1994-07-27 16:50 ` Peyton Bland
  0 siblings, 2 replies; 3+ messages in thread
From: Peyton Bland @ 1994-07-26 22:31 UTC (permalink / raw)


Has anyone had problems with statement functions in Fortran?  (I know, I
know, I shouldn't be using Fortran!)  We are running OSF/1 v1.3 on a DEC
Alpha and using their f77 compiler.

Anyway, a fragment of my program looks like

    else if ( line(2:end_section(line)) .eq. 'PROGRAM-HEADER' ) then

where end_section is a statement function defined earlier; it returns an
integer*4 value.  The compiler says "missing keyword" at the "t" in "then".

Here's the good part:  If I shorten 'PROGRAM-HEADER' to 'PROGRAM-HE', no
complier errors!  A similar statement later compiles OK if I shorten
'END-REGION' to 'END-'.  There is similar erratic behavior with other
statement functions in other if-then-else blocks.  (This routine compiled
and ran OK on another system by the way so I know I'm not too crazy!)

Thanks in advance for any comments!
Peyton

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Peyton Bland                   Digital Image Processing Lab
Dept. of Radiology                   University of Michigan
-----------------------------------------------------------
"We all have better moments than anybody ever knows, and so
do all the others....  We are a great mystery.  Each one of
us is a secret, and on that basis we ought to treat each
other with the deepest respect."
                                        -- Garrison Keillor
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Q: Fortran statement function problem
  1994-07-26 22:31 Q: Fortran statement function problem Peyton Bland
@ 1994-07-27  6:54 ` system PRIVILEGED account
  1994-07-27 16:50 ` Peyton Bland
  1 sibling, 0 replies; 3+ messages in thread
From: system PRIVILEGED account @ 1994-07-27  6:54 UTC (permalink / raw)


Peyton Bland (peyton.bland@med.umich.edu) wrote:
: Has anyone had problems with statement functions in Fortran?  (I know, I
: know, I shouldn't be using Fortran!)  We are running OSF/1 v1.3 on a DEC
: Alpha and using their f77 compiler.

: Anyway, a fragment of my program looks like

:     else if ( line(2:end_section(line)) .eq. 'PROGRAM-HEADER' ) then

    [deleted]

I suppose that your "then"-statement in that line goes over column 72.
FORTRAN ignores all characters after column 72 (comment characters).

Try to put the "then"-statement on a continuation line or something
other to make this line shorter.

Michael Polnick
TU Dresden


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Q: Fortran statement function problem
  1994-07-26 22:31 Q: Fortran statement function problem Peyton Bland
  1994-07-27  6:54 ` system PRIVILEGED account
@ 1994-07-27 16:50 ` Peyton Bland
  1 sibling, 0 replies; 3+ messages in thread
From: Peyton Bland @ 1994-07-27 16:50 UTC (permalink / raw)


In article <peyton.bland-260794182243@86.12.med.umich.edu>,
peyton.bland@med.umich.edu (Peyton Bland) wrote:
> 
> Has anyone had problems with statement functions in Fortran?  (I know, I
> know, I shouldn't be using Fortran!)  We are running OSF/1 v1.3 on a DEC
> Alpha and using their f77 compiler.
> 
> Anyway, a fragment of my program looks like
> 
>     else if ( line(2:end_section(line)) .eq. 'PROGRAM-HEADER' ) then
> 
> where end_section is a statement function defined earlier; it returns an
> integer*4 value.  The compiler says "missing keyword" at the "t" in "then".

Sorry folks - my mistake!  The problem was that my source lines were
occassionally longer than 72 characters.  However, the system from which I
was porting this uses "f77 -72 ..." to allow longer lines, and the Alpha's
compiler uses "f77 -extend_source ...".  I hadn't changed the makefile, and
the compiler didn't complain about an invalid keyword!  Oh well...
Peyton

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Peyton Bland                   Digital Image Processing Lab
Dept. of Radiology                   University of Michigan
-----------------------------------------------------------
"We all have better moments than anybody ever knows, and so
do all the others....  We are a great mystery.  Each one of
us is a secret, and on that basis we ought to treat each
other with the deepest respect."
                                        -- Garrison Keillor
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1994-07-27 16:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-07-26 22:31 Q: Fortran statement function problem Peyton Bland
1994-07-27  6:54 ` system PRIVILEGED account
1994-07-27 16:50 ` Peyton Bland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox