Re: Resulting string from concatenation operator?
- From: Peter Flass <Peter_Flass@xxxxxxxxx>
- Date: Tue, 29 Mar 2011 20:05:05 -0400
On 3/29/2011 6:34 PM, Thomas David Rivers wrote:
Peter Flass wrote:
By FIXED I assume you mean nonvarying. I don't think the result is
affected by whether the result is varying or nonvarying. As far as I
know this is an implementation decision. Iron Spring creates a
nonvarying temporary and a descriptor to identify the actual length.
Unfortunately a temporary may be required in some cases or something
like 'A=B||A;' might produce strange results. Lots of optimizations
would be possible here.
Hi Peter,
Yeah - I guess the result would necessarily be the same if it were done
consistently. If the temporary were nonvarying or varying, it would need
to be converted to the result string in either case.
I was just surprised that the result type of concatenation isn't completely
defined.
By the way, what temporary would you create for a CHARACTER(*) VARYING
(e.g. from an incoming parameter value) - would that necessarily be the
size of
the largest possible nonvarying string?
Since the compiler always knows the length of a VARYING (or adjustable) operand when the concatenation is performed the temporary is always exactly long enough to hold the result.
- Dave Rivers -
(and, yeah - please excuse my poor use of FIXED - I meant NONVARYING; gotta
be careful not to mix these things.)
Terminology is pretty confusing sometimes. I think IBM now allows NONVARYING as an attribute in declarations.
.
- Follow-Ups:
- Re: Resulting string from concatenation operator?
- From: Thomas David Rivers
- Re: Resulting string from concatenation operator?
- References:
- Resulting string from concatenation operator?
- From: Thomas David Rivers
- Re: Resulting string from concatenation operator?
- From: Peter Flass
- Re: Resulting string from concatenation operator?
- From: Thomas David Rivers
- Resulting string from concatenation operator?
- Prev by Date: Re: Resulting string from concatenation operator?
- Next by Date: Re: Resulting string from concatenation operator?
- Previous by thread: Re: Resulting string from concatenation operator?
- Next by thread: Re: Resulting string from concatenation operator?
- Index(es):
Relevant Pages
|