× 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: Retrieving a Pointer to an Object
  • From: "Simon Coulter" <shc@xxxxxxxxxxxxxxxxx>
  • Date: Fri, 26 Jun 98 23:19:53 +1000

Hello Tim,

I fear I am about to get shot again but ptr++ is a very unintelligent way of 
incrementing a pointer.  It may 
be fine in code for which you own all the parts but it will bite you if you do 
that with structures owned by 
someone else.  For example many of the SPI APIs return information to a space 
described by a structure.  The 
common C language technique of incrementing a pointer to the structure will 
break when IBM increases the 
amount of information returned in that structure.  This is because the pointer 
is incremented by the declared 
size of the structure so if the amount of data returned is greater than the 
structure your code will break.  
Recompiling (to pick up the new structure) is the minimum required fix.  The 
correct approach is to increment 
it by the amount of returned data and so remove release dependencies.  Of 
course the interface/structure must 
be designed to provide the amount of returned data.

Regards,
Simon Coulter.

//----------------------------------------------------------
// FlyByNight Software         AS/400 Technical Specialists
// Phone: +61 3 9419 0175      Mobile: +61 0411 091 400
// Fax:   +61 3 9419 0175      E-mail: shc@flybynight.com.au
// 
// Windoze should not be open at Warp speed.
 

//--- forwarded letter -------------------------------------------------------
> X-Mailer: Windows Eudora Light Version 3.0.1 (16)
> Date: Thu, 25 Jun 98 15:37:26 +1000
> From: "Tim McCarthy" <twmac@mindspring.com>
> To: MIDRANGE-L@midrange.com
> Reply-To: MIDRANGE-L@midrange.com
> Subject: Re: Retrieving a Pointer to an Object

> 
> Yes I am on the wrong ILE RPG release - glad to hear it's changed. I
> completely disagree though that pointer math is pretty horrible at the best
> of times. Show me a simpler construct than ptr++;
> 
> At 12:46 PM 6/25/98 -0400, you wrote:
> >
> >Well pointer arithmetic is pretty horrible at the best of times, but if you
> >think it's worse in RPG than in other languages you're just not on the right
> >release!  Pointer math was introduced in V3R7.
> >
> >Jon Paris - AS/400 AD Market Support - paris@ca.ibm.com
> >Phone: (416) 448-4019   -   Fax: (416) 448-4414
> 
> 
> +---
> | This is the Midrange System Mailing List!
> | To submit a new message, send your mail to MIDRANGE-L@midrange.com.
> | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
> | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
> | Questions should be directed to the list owner/operator: david@midrange.com
> +---
> 

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-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 ...

Follow-Ups:

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.