× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Geert Van Landeghem wrote:

   How do I define these characters in RPG? A command is executed from
   within
   a RPG program which launches a java program (to send an e-mail).
   The body of the mail is a string containing multiple lines. How to
   define the \r\n
   in an RPG string so it will be read correctly in the java program as
   parameter
   being passed to it?


My advice is don't try.  I mistrust the kinds of translation headaches that
come from passing around "control" characters of that sort in EBCDIC,
ASCII, or whatever else there is in the world.

You didn't say, but I assume your source string is in some EBCDIC code page
and that the \r\n is not present already in the input?

I would instead figure out how to pass the length of each line in some
fashion and make that part of what you pass in (I assume this multi-line
string is passed in as one large parameter?).  You can pass it as some
suitable second parameter.  You could define a convention like "a three
digit number tells how many lines and then N three digit numbers tell how
long each string is" for the second parameter.  That's probably easiest and
no translation worries.

Java can then trivially add the \r\n itself if that's required in however
you define the mail handling code in Java.

--

Larry Loen, Senior Programmer iSeries Java and Linux analysis




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 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.