• Subject: Re: prototyped fields & global field definitions
  • From: "David Prowak" <prowakd@xxxxxxx>
  • Date: Thu, 1 Oct 1998 18:27:51 -0400

Well, I think that I just answered my own question.
 
>From the ILE RPG REF:
Any items defined within a subprocedure are local.  If a local item is
defined with the same name as a global data item, then any references to
that name inside the subprocedure use the local definition.

So any reference to FIELD_1, uses the local definition.  That explains why
the
value that I was passing into PROC_A  was showing up properly when I
examined my code w/debug, but the globally define FIELD_1 wasn't reflecting
this value.
----------
> From: David Prowak <prowakd@emi.com>
> To: midrange list <midrange-l@midrange.com>
> Subject: prototyped fields & global field definitions
> Date: Thursday, October 01, 1998 2:48 PM
> 
> Hi,
> In a procedure I have
>       D PROC_A                PI
>       D FIELD_1                       12
>       D FIELD_2                         8
> In the same procedure, I have a DSPF file 
> defined globally (that is, the F spec comes before the procedure B
> statement).
> 
> In the DSPF file, I have FIELD_1 defined as a program-to-system field.
> 
> I'm trying to get the FIELD_1 that is passed in when PROC_A is called
> to be sent to the DSPF in the form of the program-to-system field.
> 
> When the procedure runs, FIELD_1 does not reflect the value of
> FIELD_1 that was passed in with the call to PROC_A, and the compile
> lists message ID
>  *RNF7031 - name is not referenced 
> for the FIELD_1 definition listed  with the DSPF field references.
> 
> I thought that having the DSPF defined globally was relative to
> the compile unit, so that any fields defined locally within
> that same compile unit would be aware of the global definitions.
> That's not the behavior that I'm witnessing.
> Can anyone clear up my misconceptions?
> TIA,
> Dave
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> +---
> | 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 thread ...


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.