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



>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?
Correct. The text is being built when composing the mail message.

>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 ...
Or use a special character to delimit line breaks? (and use StringTokenizer or 
..)

Apparently, all I needed was X'0D'? The other solutions mentioned gave strange 
results like this:

Line 1 : Hello?
ZLine 2 : Whats up?
Z
ZLine 4 : Going to the Boss tonight!

Thanks to all
Geert

-----Original Message-----
From: Larry Loen [mailto:lwloen@xxxxxxxxxx]
Sent: vrijdag 9 mei 2003 15:49
To: Java Programming on and around the iSeries / AS400
Subject: Re: Question about \r\n



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



_______________________________________________
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) 
mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo.cgi/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.



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.