Thanks for all these answers. I’m going to go back and try them all. I was
able to use evalr mystring = %trim(mystring)

On Wed, Jul 3, 2024 at 4:22 PM Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>


Personally, I see interesting challenges in your example -- things that
I'd enjoy exploring an answer to. Namely, in order to know what the
return value should be, you'd need to know how the caller's variable is
defined, since that is what determines the number of blanks to prepend.

But... you didn't ask about that. Instead you asked the 101 basics of
how to code a CONST and return value on a prototype... which tells me
that this is probably your first subprocedure...

You also didn't explain why you need a procedure at all when EVALR
already does what you want to do in 1 line of code. (And, for sure,
there are good reasons to use a procedure -- but you didn't mention any
requirements that lead to that conclusion.)

And I don't understand your thought process in throwing *CONVERT into
the message. What does *CONVERT have to do with the question? What are
you thinking, here?

On 7/3/2024 1:58 PM, Art Tostaine, Jr. wrote:
I want to do something like this:

dcl-s mystring char(50);
mystring = right('ABC1234');

and "right" returns a string that is 50 characters long with ABC1234
justified. I Can code the procedure, but how do I define my dcl-proc and
dcl-pi so I can send in a constant and return my value to mystring?

I've been googling and saw *CONVERT and some other things but I can't get
it right.

Thanks for any help.
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by 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.