Newsgroups: comp.lang.fortran
From: Ron Shepard <ron-shep...@NOSPAM.comcast.net>
Date: Sun, 21 Oct 2012 01:31:14 -0500
Local: Sun, Oct 21 2012 2:31 am
Subject: Re: Function returning defined type?
In article
<91b30443-7f8c-490f-8d4d-a076d4996...@b6g2000yqd.googlegroups.com>, jski <john.chludzin...@gmail.com> wrote:
The other good reason for doing this is when the function is used in > On Oct 21, 1:02 am, jski <john.chludzin...@gmail.com> wrote: > > On Oct 20, 5:00 am, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote: > > > john.chludzin...@gmail.com wrote:
> > > (snip)
> > > > type(hash_tbl_sll) :: table
> > > Yes, Fortran isn't C or C++. In C, [], (), and . are operators,
> > > You can't subscript (asked reasonably often), call, substring,
> > > -- glen
> > Hmmmm ... think I'll charge "get" back into a subroutine.
> > BTW, into what category in Fortran does "%" fall?
> > ---John
> ... think I'll CHANGE "get" back into a subroutine.
a print or write statement (as you were trying to do), then you can then not do any i/o within the function (e.g. for debugging, for printing error messages, or anything). This is called "recursive" i/o, and it is not allowed at all up through f95, and only in some restricted situations in the newer standards. So it is better to just avoid the problem in the first place by using a subroutine rather than a function. $.02 -Ron Shepard
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||