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



Kristof,

I can confirm your findings; the same thing happens on V7R3M0.

It appears to be happening when the temporary variable is constructed for
the call to TestEncode. In debug you can see that what TestEncode receives
is incorrect. Hex:

00000 001A0000 00000000 001AA340 C195A388 - ..........t Anth
00010 969589A2 40D29989 A2A39686 00000000 - onis Kristof....

It starts with '001A' - length of 26. But the following hexadecimal zeros
are not characters.

Definitely a bug.

Joep Beckeringh
Software Architect
Pantheon Automatisering B.V.
Heerenveen



Kristof Anthonis <Kristof.Anthonis@xxxxxx>

07-03-2018 15:06

Strange problem (bug?) varying fields

Hello,

I have a very strange problem using varying fields in RPG. We are
running on V7R2.

I 've defined these three fields:


d Wrk_XML s a len(131064) varying
d Wrk_S1 s a len(5000) varying
d Wrk_S2 s a len(5000) varying
I than run the following code. The TestEncode function does not in
particular here, but in the real business case I want to do
something there. This is just to show te problem.

Wrk_XML = '';
Wrk_S1 = 'Anthonis';
Wrk_S2 = 'Kristof';
Wrk_XML = Wrk_XML + '<Subject>' +
TestEncode(
'LabResult ' +
Wrk_S1 + ' ' + Wrk_S2) +
'</Subject>';
p TestEncode b
d TestEncode pi a len(5000) varying
d pi_s a len(5000) const varying
/free
Return pi_s;
/end-free
p TestEncode e
The result in Wrk_XML = <Subject> t Anthonis Kristof</Subject>
So, that is not correct.

When I change the definition of WRK_XML to

d Wrk_XML s a len(131063) varying

The result in WRK_XML = " <Subject>LabResult Anthonis Kristof</Subject>"
That is correct.

Can anyone explain this: why is this working ok for a length of
131063 or less, and not ok for 131064 and above?

Thanks for any answers!!
Kristof Anthonis

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.