Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Function returning defined type?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
jski  
View profile  
 More options Oct 21 2012, 1:03 am
Newsgroups: comp.lang.fortran
From: jski <john.chludzin...@gmail.com>
Date: Sat, 20 Oct 2012 22:03:49 -0700 (PDT)
Local: Sun, Oct 21 2012 1:03 am
Subject: Re: Function returning defined type?
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
> > > ...
> > > call table%put(1, Coords(1, 2, 3))
> > > print*, table%get(1)%x
> > > This results in:
> > > $ gfortran HashTbl.f95
> > > HashTbl.f95:173.22:
> > >  print*, table%get(1)%x
> > >                      1
> > > Error: Syntax error in PRINT statement at (1)
> > > This may be too C/C++'esque but the returned value is type(Coords),
> > > shouldn't I be able to reference a member?

> > Yes, Fortran isn't C or C++. In C, [], (), and . are operators,
> > but they aren't in Fortran.

> > You can't subscript (asked reasonably often), call, substring,
> > or select structure members from the return value of a function.

> > -- 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.

 
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.