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




On 5-Feb-08, at 12:11 PM, rpg400-l-request@xxxxxxxxxxxx wrote:

I'm trying to use a pointer to a data structure to pass data back from a
sub procedure. I had it working at one point but have since made some
changes and now it doesn't work. What's happening is $obcGetType loads


This has been discussed before on this list but the simple answer is "stop doing it - it will make you go blind".

The DS in the subprocedure is in dynamic storage as are all subprocedure variables not specified as STATIC. The storage is released when the subprocedure does a Return. So the fact that it ever "worked" was either good or bad luck depending on your perspective.

A better approach is to have the caller pass the DS that it wants filled to the subprocedure as a parameter and have the subprocedure return a found/not found indicator to the caller.

It is always a bad idea to pass to another routine a pointer to data that you don't "own".

Jon Paris

www.Partner400.com
www.SystemiDeveloper.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.