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



Joe Pluta wrote:
> 
> If I declare a based data structure (EXTNAME and BASED) in a procedure,
> what is allocated when I call the procedure?  Common sense tells me it's
> just the room for the pointer; that all references to the field are done
> via pointer arithmetic.
> 

Indeed, no storage is allocated for the structure.  Even the storage for
the pointer might not be allocated in the subprocedure, for example in
the case that Bob mentioned where the pointer is passed in as a
parameter.

You can verify that this is so by compiling the following module with
and without the BASED keyword and then doing a DSPMOD OPTION(*SIZE) and
paging down to the Procedure Size section.  It should show different
values for the Current Size of the automatic storage allocation.

h nomain
D proc            pr
P proc            b
D dsAuto          ds          1000    based(p)
P proc            e


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.