Kurt Anderson wrote:
...
However, I now realize that using D-specs like that is redundant.  It
really only needs to be done like this:
     d MyArray         s             10a   based(pMyArray)
Kurt, I think it's a good idea to define the basing pointer explicitly 
even though the compiler will define it for you.
There is a nasty gotcha with based variables defined in subprocedures. 
If you code BASED(globalPointerName), thinking you will base your 
variable on a global pointer, the compiler will define a local pointer 
for you with the pointer name, but in the code, it will appear as though 
the local based variable is actually based on the global pointer.  This 
misunderstanding can cause some interesting debugging sessions.
If you always define the pointer at the same place as you define the 
based variable, you will avoid this kind of problem, especially if you 
always chant this while you're coding the pointer: "The basing pointer 
must be in the same scope as the based variable".
As an Amazon Associate we earn from qualifying purchases.
	
 
This mailing list archive is Copyright 1997-2025 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.