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



 > So, even though I never actually allocated any storage in the calling
program, I could still set the occurrence to different records once I've set
the basing pointer to equal the pointer returned from the I/O module?

You got it.  It is the reverse of passing parameters.  When you pass a parm
you pass only the address (pointer) to storage in the caller.  The callee
doesn't declare storage - just maps his definition (i.e. "Bases" his
definition) on that pointer.  When the callee changes memory he is changing
the original callers memory.

In your scenario you are doing the reverse - you are receiving a pointer to
the storage allocated by the callee and using to base your definition - but
the principal is the same.  Don't forget by the way that if the IO routine
is a subprocedure (which it should be) the pointer that you are returning
should be declared as STATIC or it will disappear and you will never be able
to free the heap memory allocated to it until EOJ.

Having said all that - given that the routine you call is a generic one used
by many different functions, I'm not convinced that dynamic memory is really
needed.  Why not just use fixed memory in the callee and map to that.  Or
for that matter use IMPORT/EXPORT.

Jon Paris
Partner400




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.