|
On 2/14/23 2:27 PM, Roger Harman wrote:
Why on earth would you do all that manipulation when a simple opcode
does the job?
Because that simple opcode *doesn't* do the job by itself.
Consider:
D FOO S 50A
D BAR S 50A
D BAZ S 50A
C EVAL FOO = 'FOOBAR'
C EVALR BAR = FOO
C EVALR BAZ = %TRIM(FOO)
C FOO DSPLY
C BAR DSPLY
C BAZ DSPLY
C SETON
If you compile and run this, you get:
DSPLY FOOBAR
DSPLY FOOBAR
DSPLY FOOBAR
If the EVALR were *all* it took to forcibly quad a string to the right, then the second line of the output would look like the third, not the first.
As to explicitly adding spaces on the left, that would only be necessary if you were using a version of ILE RPG that lacked the EVALR.
--
JHHL
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.