× 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: C like Data Structure Definitions?
  • From: Jim Langston <jimlangston@xxxxxxxxxxxxxxxx>
  • Date: Wed, 10 Jan 2001 14:00:38 -0800
  • Organization: Pacer International

Umm.. uhhh... okay.

Then I don't have a problem at all.

I define RNF_Data as a data structure in my //copy member, and use that
for both my library and my program.  The program has an RNF_Data global
to it, and the library has another RNF_Data global to it.

That should of occurred to me.

I guess I was getting confused with C where in certain cases the RNF_Data
would be global to both.

Regards,

Jim Langston

Scott Klement wrote:
> 
> 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
> +---
+---
| 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 thread ...

Follow-Ups:
Replies:

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.