|
Wow! I had no idea that the definition of a good language was that it had to support pointer math! I guess everyone had better forget about JAVA, Visual Foxpro, Visual Basic, etc. Gee, it makes me wonder how I've ever coded a decent system without using pointers. :[ Eric A DeLong ericadelong@pmsc.com ______________________________ Reply Separator _________________________________ Subject: Re: Retrieving a Pointer to an Object Author: <MIDRANGE-L@midrange.com> at INTERNET Date: 6/26/98 12:36 PM Simon, I fear you have not been long coding in C. The very "unintelligent" ptr++; is probably the most common C statement I can think of beside 'if'. Hey, most C examples even call their pointers 'ptr'. If you have a better way of parsing a string then legions of C programmers would love to hear from you. I understand what you're saying about using IBM API structures and offsets but you completely missed the point I was making which had nothing to do with these API's. Pointer arithmetic (which goes beyond simple incrementing) is an essential part of any good programming language. I'm very familiar with using supplied offsets to position to information structures and I don't believe I was proposing anything else. But thank you for the "re-fresher" anyway. At 11:19 PM 6/26/98 +1000, you wrote: >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 >+--- > +--- | 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 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.