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


  • Subject: Re: Variable length MODS
  • From: Scott Klement <klemscot@xxxxxxxxxxxx>
  • Date: Mon, 16 Apr 2001 17:05:53 -0500 (CDT)



> What you said sounds right to me. If you simply want to use pointers, forget
> the DIM or OCCURS and just user pointer arithmetic and be sure you don't
> lose track of what you're trying to access vs what you allocated memory for.

I agree with this as well.  If you don't want the 9999 limit, don't use
a MODS.  Just use a based data structure and pointer arithmetic.
This is so easy to do on the V4Rx versions that you might as well!

(I used to do this on V3R2, using user spaces and a home-written
"offsetptr" routine because I didn't have the ALLOC op-code or the
ability to do direct pointer math, but needed a larger MODS)

The use of the OCCUR op-code is awkward to say the least.  Why bother
with it?  


> My only suggestion would be to comment thoroughly enough for the next
> programmer who may not be up on pointers and could go off into left field.

That's true.  A lot of RPG programmers will go and run and hide under 
the bed when they hear the word "pointer".   It's too bad...   But if
we keep trying, eventually we'll get them to accept things like pointers,
procedures, and the discovery of fire...

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.