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



Hello,

So Program1 could first call Program2 and get a list of procedure
names and pointers, then call it a second time with a particular
pointer?

Yes, absolutely. I do that occasionally... The only important bit is that you make sure that Program2 stays activated. (Put it in a named activation group, for example.) Otherwise the pointers won't be valid, and "unpredictable results" will occur.

This type of logic is useful if you want to create a "plugin" type of interface for add-ons to your application.

For example, tools like Firefox, Apache, Thunderbird, etc, have "plugins" that you can download and install into the system. The programmers who wrote these tools needed some way to call a broad set of routines (subprocedures) that are not known at compile-time. If you wanted to do something like that in *your* applications, you could use this technique.... call a program with the CALL opcode, and have that program return a data structure with procedure pointers to all of the necesssary routines -- then call the routines directly via pointer.

There are lots of examples of this in the IT industry. Windows Printer, Video, and Sound drivers are an example of "plugged in" code. I've already mentioned Firefox, Thunderbird and Apache and their add-in modules. Video codecs in Windows Media player is another example. Database ODBC drivers are another... the list goes on and on...

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.