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



I finally managed to get back to this issue, after putting out some brushfires elsewhere.

Joe Pluta wrote:
Hmmmm... here's one possibility: overlay with yet another array, this time of 5u0. Then you can easily run
through the array backward looking for a
value that's neither 0 (null) or 64 (blank).

Not quite: remember, Unicode blanks are x'0020' -- in other words, 32, not 64.

But that's close enough for jazz, and it did the trick.

Barbara Morris wrote:

James, I agree with Jon that you should just define the
field as unicode (type C). It doesn't sound like you need
the character version of the data.

Then, to assign your parameter to the varying unicode
field, just use %TRIM where the second parameter for %TRIM
is blank+null. The length part of the varying field will
be handled automatically. (I'm assuming you have unicode
(double-byte) blanks.)

D mypgm pi
D parm 18383c const
D varUnicode s 18383c varying
 /free
      varUnicode = %TRIM(parm : u'00200000');

Type C? /free? Remember, we're using a V4R4 RPG compiler. Most of our customers are probably on V5, but not necessarily all, and we only have one test box, with no compilers at all, running V5.

Your other idea, of constructing the RPG VARLEN string from C would work extremely well, except for one problem: the C module doesn't know anything about the structure of the data. It's just passing a block of bytes. But thanks.

--
JHHL

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.