|
> -----Original Message----- > From: Jim Langston [mailto:jlangston@conexfreight.com] > Sent: Monday, February 28, 2000 2:52 PM > To: RPG400-L@midrange.com > Subject: Re: RPG IV Pointers > > > Okay, so, can I do this? > > D MyPointer S * > D MyField S 50 > C Eval > MyPointer = %Addr(MyField) > Yes, you're assigning the MyPointer the address of MyField. > Is that equivalent to: > > D MyPointer S * > D MyField S > 50 Based(MyPointer) > Yes and no. MyPointer needs to contain a legitimate address for you to do anything predictable with MyField. As long as you assign the MyPointer an address by pointing it at another field or allocating heap memory for it this will work. The difference between the two cases is that in case 1 MyField has an address independent of the contents of MyPointer, while in case 2 the address of MyField depends on the address contained in MyPointer. You can get yourself in the same trouble you can get into in C, the syntax is just a little bit different. > Regards, > > Jim Langston > > +--- | 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 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.