Re: Problem in declaration



nure123@xxxxxxxxx wrote:
Thank you all.

The way subroutine in which this statement, INTEGER*4 JR*2(INT),
occurs is called and the code in the subroutine show that JR is indeed
an array of size INT.

It seems that I need to have a reference book on MS FORTRAN. I
searched the Amazon and GOOGLE Books, I could not find any. Sjouke
could you please tell me whether the reference book you referred is a
book dedicated to MS FORTRAN or MS FORTRAN is given in an appendix. In
any case, I would be grateful if you could send me the name of the
book so that I can procure it.

Moreover, if don't mind, I will be grateful if you could tell me what
might be wrong with the following statement inside a subroutine.

CHARACTER CO [REFERENCE]

with CO being a variable passed to the subroutine.
Book:
Microsoft Fortran reference Version 5.1 for os2 and dos operating systems, page 190/191 for the integer reference.

For your char statement, page 29(quite new to me :) ) states:
"The reference attribute can only be applied to formal arguments,
it specifies that the arguments memory location is to be passed, rather than the arguments value. This is called 'passing by reference'.

My remark, this seems to be the default type of a formal argument in
MS 5.1 fortran , and it seems that [external] is a bit overstating the obvious.

However, [VALUE] is its opposite attribute, and useful for calling
routines which expect values, although the [C] attribute takes care
of that(and more) for calling c routines.

Example(an interface def):
A c function and subroutine from a C graphics library:

c extern int far getpoint (int x, int y);
c fortran interface:
INTERFACE TO FUNCTION getpoint(x,y)
INTEGER*2 getpoint[C],x,y
END
c subroutines---------------------------------------------------------
c extern void far drwpoint (PixelMode mode, int colr, int x, int y);
INTERFACE to subroutine drwpoint[C](mode,colr,x,y)
INTEGER*2 mode,colr,x,y
END

If you want to know more, decipher my email adress,real figures after the name, and single letters behind the @.
And no, you cant have my manuals, I still use them. :)
.



Relevant Pages

  • Re: Pass by reference or by value?
    ... subroutine bar ... It is common to pass constants and expressions to Fortran procedures, ... You can pass a reference to a constant just as easily as you can pass a reference to a variable. ... Some early Fortran compilers omitted this small but important detail, leading to programs with incomprehensible semantics, as the values of numeric literals could no longer be relied upon. ...
    (comp.lang.python)
  • Re: beginners question
    ... If you pass a literal to a subroutine, the compiler puts the ... literal into a temporary variable and passes a reference to that ... Also, since FORTRAN was developed at a time when memory was very tight, ...
    (comp.lang.perl.misc)
  • Re: Calling C++ from Fortran
    ... and it was suggested I post to a Fortran ... | int FillRandom; ... You declared FillRandom with REFERENCE attribute, ... length, passed by value, immediately succeeding the string address. ...
    (comp.lang.fortran)
  • Re: Form k = i + j and test for overflow.
    ... One would not expect to call a subroutine without ... In C operations such as addition of types smaller than int are done ... after converting to int. ... I don't believe that Fortran does the same thing. ...
    (comp.lang.fortran)
  • Re:Problem to call fortran from C with linux ifc/gcc
    ... The subroutine in a module is the problem. ... r linux fortran 90. ... >I tried to see the reference in the .o: ... >Someone has an idea to compile my program? ...
    (comp.lang.fortran)