Re: Proper way to return a string
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Fri, 29 Dec 2006 23:05:38 -0800
Beliavsky <beliavsky@xxxxxxx> wrote:
I don't think a function have a character(len=*) RESULT
Yes, it can. It just doesn't mean what you would think. It means that
the length is declared in the calling program - *NOT* determined by
anything in the function. This feature is obsolescent. I'd say that at
least 90% of the people who try to use it don't understand what it does.
(Our beloved writer of non-working TRIM functions probably does
understand, but intentionally trolls; and gets far too many bites from
people who should just kill-file him.)
Error: Internal function 'str_func' at (1) cannot be an assumed-length
CHARACTER
I'm too tired to check right now, but an internal function with a len=*
result would be at least ... strange. Might be disallowed. Or I could
well imagine compilers having trouble with it if it were allowed. But
this is specific to internal functions - not external or module ones.
Hmm. I can't see how the calling routine could declare the length of a
char(len=*) internal function. That would be two different declarations
in the same scope. That probably effectively disallows them even if
there isn't an explicit prohibition. You are required to declare the
length (and as something other than *) in the calling scope. So if you
can't do that in some context, you can't have such a function there.
--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.
- Follow-Ups:
- Re: Proper way to return a string
- From: Walter Spector
- Re: Proper way to return a string
- References:
- Proper way to return a string
- From: Jeremy
- Re: Proper way to return a string
- From: Steven G. Kargl
- Re: Proper way to return a string
- From: Gordon Sande
- Re: Proper way to return a string
- From: Ron Shepard
- Re: Proper way to return a string
- From: Beliavsky
- Proper way to return a string
- Prev by Date: Re: Proper way to return a string
- Next by Date: Re: Proper way to return a string
- Previous by thread: Re: Proper way to return a string
- Next by thread: Re: Proper way to return a string
- Index(es):
Relevant Pages
|
|