|
Jim, The pointer is global to the module or subprocedure that /COPY's it in, but is not global across the whole application. i.e. the service program has a seperate copy of RNF_Data@ from the one thats in the regular program. /COPY just inserts the D-specs into your source code before compiling them, and should behave exactly the same as if you typed the D-specs into each source member manually. Of course, if you have subprocedures/subroutines within the same module that modify the RNF_Data@ pointer, you'll have to make sure the pointer gets changed back... Its not a perfect solution... On Wed, 10 Jan 2001, Jim Langston wrote: > Scott, > > Hmmm... this gets rid of my problem about my data being public, > but... in this case don't I just have one copy of the data structure > out there? > > As I understand your C method, to use this I would have to do something > like: > > *** In the copy source the data structure RNF_Data is set up based on > RNF_Data@ *** //COPY QMODSRC,SYSTEMPR > > D RNF_Data# S 107A > > C Eval RNF_Data# = RNF_Open('QPGMR': 'ICS400') > C Eval RNF_Data@ = %addr(RNF_Data#) > > C DoW NOT RNF_Data = *Blanks > > C If NetFile = 'MYFILE' > ... > C Eval RNF_Data# = RNF_Read > C Eval RNF_Data@ = %addr(RNF_Data#) > > C EndDo > > The whole point being, I am going to have to reset the pointer to my > local data buffer every time I call a function that could set it to > it's own local data buffer (like RNF_Open and RNF_Read would do). > > I like it, I just don't like the side effect of functions changing my > pointer, which is at this point a global variable. > > 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.