|
Statement one deallocates the storage and set the pointer to null.
I don't believe this is true. It won't set the pointer to null. In order to do that, you need the (n) extender: Dealloc(n) myField_P; Kurt Anderson Application Developer Highsmith Inc -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Alan Campin Sent: Wednesday, December 06, 2006 12:43 PM To: rpg400-l@xxxxxxxxxxxx Subject: RE:dealloc (Correction) <snip> Assuming that myField_P is the based of myField, does these two statements yield same result? Statement 1 ==> dealloc myField_P; Statement 2 ==> myField_P = *null; </snip> No, statement 2 sets the value of the pointer to null but does not deallocate the storage. It's possible that the OS would generate a runtime error if you tried but I have never tried. You could prove by going into a loop, allocating a block or storage and then moving in null. At some point, the program is going to crash because it is out of heap storage. Statement one deallocates the storage and set the pointer to null. ------------------------------ -- This is the RPG programming on the AS400 / iSeries (RPG400-L) digest list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. End of RPG400-L Digest, Vol 5, Issue 1327 *****************************************
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.