On Fri, 2011-11-18 at 10:48 -0800, Tom Clune wrote:
> I'm fairly certain that the following is not allowed by the standard,
> but I could not readily find words that cleanly settle it. If one
> has a function which returns an object of derived type, can one
> directly use component selection on the return value, or must one
> always declare a variable of the corresponding type and split the
> expression across 2 executable statements?
>
>
> type BASE
> integer :: i
> contains
> procedure :: method
> end type BASE
>
>
> ....
>
> function getBase() return(obj)
> type (BASE) :: obj
> ....
> end function getBase
>
>
> ...
>
>
> print*, getBase()%i ! Is this allowed?
There's no syntax for it.
> ! or the F2k equivalent:
> call getBase()%method() ! is this allowed?
>
>
>
>
> -------------------
>
>
>
>
> Thanks in advance,
>
>
> - Tom
>
>
>
>
>
>
>
> Thomas Clune
> Chief, Software Systems Support Office
> NASA GSFC (610.3) B33-C128
> 301-286-4635 (W)
> <[log in to unmask]>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|