Re: double confusion
- From: Gordon Sande <g.sande@xxxxxxxxxxxxxxxx>
- Date: Mon, 17 Jul 2006 13:37:32 GMT
On 2006-07-17 09:55:13 -0300, "Julian Bessenroth" <jbusenet@xxxxxx> said:
Ian Bush schrieb:
How is it different from C ?
If the subprogram and the main program were in different files and compiled
separately how could you ensure that the main program knows what return
type the function has ?
But these declaration are located onlz _once_ at the begining of the
file (before the main routine starts). Fortran requires its
declarations "within the main routine" and within every
subroutine/function where i'm going to use the this function, and what
confuses me somewhat more, that it's just required for double
precision, but not for integer or real ...
You could try to use an "IMPLICIT NONE" and see what happens.
When you rely on defaults one of the problems is that you have
to know what the defaults actually are. In Fortran the default types
are integer and real according to the initial letter.
Fortran has no notion of file scope so the beginning is actually the
beginning of the main program. It would be much clearer if you had used
a PRGOGRAM statement. Then you would have gotten an obscure diagnostic
about two main programs which would have indicated that something was
not quite as you had guessed it to be.
regards
Julian
.
- Follow-Ups:
- Re: double confusion
- From: glen herrmannsfeldt
- Re: double confusion
- References:
- double confusion
- From: Julian Bessenroth
- Re: double confusion
- From: michael
- Re: double confusion
- From: Julian Bessenroth
- Re: double confusion
- From: Ian Bush
- Re: double confusion
- From: Julian Bessenroth
- double confusion
- Prev by Date: Re: writing output listing onto screen (or not) and onto file
- Next by Date: Re: Algorithm for distance from point to function
- Previous by thread: Re: double confusion
- Next by thread: Re: double confusion
- Index(es):
Relevant Pages
|
|