|
From: | Michael Anderson |
Subject: | Re: [open-cobol-list] True concatenate. |
Date: | Tue, 02 Jul 2013 16:22:26 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 |
For results like so:
X=[My First Value] is 00000014 bytes. Y=[More Chars] is 00000010 bytes Now X=[My First ValueMore Chars] is 00000024 bytes. Compile using: cobc -x -free -ffunctions-all test.cob The following source: program-id. xstringy. data division. local-storage section. 77 x Pic X(128). 77 y Pic X(128). procedure division. Move "My First Value" To X. Move "More Chars" To Y. Display "X=[" trim(X) "] is " Length(trim(X)) " bytes.". Display "Y=[" trim(Y) "] is " Length(trim(Y)) " bytes". Move concatenate(trim(X),trim(Y)) To X. Display "Now X=[" trim(X) "] is " Length(trim(X)) " bytes.". Stop Run. On 07/02/2013 03:49 PM, Mark Perew wrote: STRING can be an expensive operation. If you know you're going to concatenate that way, why not do something more straightforward like: |
[Prev in Thread] | Current Thread | [Next in Thread] |