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



Mike,

It makes perfect sense to me to pass a pointer to a data structure.  I've
found it useful to just pass a pointer to a subprocedure when all that
subprocedure is going to do is pass it on to another subprocedure.  You
don't have to declare the data structure in every procedure it gets passed
through - just the procedure that has the data structure and the procedure
that is going to use it.

Declare a data structure in the subprocedure like your record layout and as
standalone field.  Included the BASED keyword on that datastructure with the
based pointer in that keyword the name of the pointer passed in to the
subprocedure.  Then you use the data structure as you would normally and
ignore the fact that it's being passed 'by address' using a pointer.

Passing in the pointer to the record format might be tricky.  You'll need a
data structure in the calling procedure and use the %Addr BIF to get the
pointer to that data structure.  You can't use the %Addr BIF on a record
format name although using %Addr on the first field in the record could be a
hack around that (making an assumption that all record fields are stored
contiguously in the program which might be working that way now but could
change in the future).


Why don't you consider breaking up your edits into different routines?  Each
routine would pass back an error indicator which you could use in your main
program.  You be passing in the required fields to the various edit routines
instead of passing in the whole record to one big huge routine that does all
the editing.

Paul

Paul Morgan
Senior Programmer Analyst - Retail
J. Jill Group
100 Birch Pond Drive, PO Box 2009
Tilton, NH 03276-2009
Phone: (603) 266-2117
Fax:   (603) 266-2333

Mike wrote

>I presume that I would include the record as a data structure in the
>second program and somehow or other 'connectt' it to the pointer passed
>in, so that the DS layout was 'overlaid' to storage from the pointer
>reference position.





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.