×
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.
<snip>
Anyway, back to original post. I just wanted to know if I can call a
subprocedure within a main program, apparently I can't so I broke it out to
a new module and I have it working.
</snip>
If you REALLY need to you CAN call a sub-procedure in one program from
another program. To do this you simply require a procedure pointer which
contains the address of the sub-proc you want to call. You can get this by
adding an extra parm to the main procedure of the callee program and make
this parm a procedure pointer. Call the program using a prototype and pass
the procedure pointer to it. Then get the callee program to populate this
parm with the address of ANY sub-procedure within it. In this scenario there
is NO need for the use of EXPORT on the sub-proc. This is because the
procedure address is known and this is all you need. You can then call the
sub-proc using a prototype based on your procedure pointer. (of course, your
prototypes should match or you may be in trouble)
If we couldn't do this then system call-back functions like CEEHDLR would
not work. For this you pass the address of one of your sub-procs to
"register" it and the system uses the procedure pointer you passed to call
your nominated sub-proc when required. That is, the system calls one of the
sub-procedures within your program object.
Probably not helpful, but this option should be noted for the archives. :-)
Cheers
Larry Ducie
As an Amazon Associate we earn from qualifying purchases.
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.