× 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.



Fisher, Don wrote:

I think I'm confused.  I defined a data structure DS1 based on a file called
FILE1 and created a pointer PTR1 initialized to the address of DS1 in a
procedure.  This procedure calls another procedure using PTR1 as the
parameter.  This second procedure also has a data structure DS1 that is
defined using FILE1 and BASED on the passed pointer.  No PREFIX is used on
either data structure.  No when the second procedure reads the file used to
define DS1, the fields in DS1 are not updated.  They're the same as the
fields in the file so what happened?

I have attempted passing PTR1 by VALUE and by reference to no avail.  No
luck either in making the BASED pointer a separate field from the passed
pointer or in creating a separate data structure.


Did you specify DS1 as a result data structure in the read opcode?


If you did not specify a result data structure on the read opcode, then the operation will update the *global* fields implicitly defined for the record, and not locally defined fields that happen to have the same names.

What to do? As suggested, you could code DS1 as a result data structure for the read operation (V5R2). Or, define DS1 as global, and not local to the procedure. You'll then have to assign the value of the pointer passed as parameter to the basing pointer of the global DS.

Cheers! Hans



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.