× 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'm with Bruce on the "magic number bit" - you should never ever hard code those buffer offsets. Bruce's example is the only way to go and will continue to work no m,after what IBM may do to the layout in the future. Note that it _has_ changed in the past and a number of programs using similar hard coded logic started to misbehave in a variety of interesting ways.

This article was written in 2002 for V5R1 which was when the change in question took place. I know I also wrote up the reasons why the old code "broke" with the change but darned if I can find it now. In essence, at V5R1 IBM started rounding up the starting position of the buffer to a multiple of 16. The result was that only one in 16 of programs that used a hard coded number continued to work. The content of this article is still valid if you want to understand the right way to handle these buffers, although these days my code would look more like Bruce's and make use of free-form, qualified data structures, etc.

http://www.ibmsystemsmag.com/ibmi/developer/rpg/iSeries-EXTRA--Are-You-Trigger-Happy-/


On 2014-05-04, at 9:01 AM, Bruce Vining <bvining@xxxxxxxxxxxxxxx> wrote:

Not seeing all of the relevant source makes debug a bit difficult, but one
question I have is where this "magic" number '96' comes from when setting
NewStart and OrgStart. In any case, here's some sample code that I threw
together and which appears to work.

Jon Paris

www.partner400.com
www.SystemiDeveloper.com





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.