Re: Problem in declaration
- From: Sjouke Burry <burrynulnulfour@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 11 Jan 2008 09:20:55 +0100
nure123@xxxxxxxxx wrote:
Thank you all.Book:
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.
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. :)
.
- Follow-Ups:
- Re: Problem in declaration
- From: Jugoslav Dujic
- Re: Problem in declaration
- References:
- Problem in declaration
- From: nure123
- Re: Problem in declaration
- From: Sjouke Burry
- Re: Problem in declaration
- From: nure123
- Problem in declaration
- Prev by Date: Re: finding unused code
- Next by Date: Combo Boxes
- Previous by thread: Re: Problem in declaration
- Next by thread: Re: Problem in declaration
- Index(es):
Relevant Pages
|
|