Gustav Brock
Gustav at cactus.dk
Wed Jun 24 01:22:39 CDT 2009
Hi Shamil Thanks for straighten this out. The link to Strategy also provides a good opportunity to compare the syntax of many languages (some of those I've never touched). /gustav >>> shamil at smsconsulting.spb.ru 23-06-2009 19:49 >>> Gustav, Charlotte, Susan, Arthur, I'd suppose that CallByName, which you have mentioned earlier in this thread, would be more appropriate for Arthur's original request: <<< Is there a way to pass the name of a function or procedure to another one? The need for this might occur when the given procedure must branch in various ways, and call a proc/function whose name depends upon the code-path, as it were. >>> As CallByName allows to pass object variables/refs as parameters, and Eval() doesn't allow to do that without some additional tricky VBA programming... BTW, what Arthur is trying to do is known as Abstraction Layer http://en.wikipedia.org/wiki/Abstraction_layer as well as Strategy http://en.wikipedia.org/wiki/Strategy_pattern or Service Locator patterns http://en.wikipedia.org/wiki/Service_locator_pattern which are in turn sub-cases of more generic (OO) programming principle called Inversion of Control: http://en.wikipedia.org/wiki/Inversion_of_Control -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, June 23, 2009 9:17 PM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Pseudo Pointer to a Function Hi Charlotte Oh my, you are right: http://databaseadvisors.com/pipermail/accessd/2005-June/035493.html /gustav >>> cfoust at infostatsystems.com 23-06-2009 19:06 >>> You can pass it as a string. The problem is you can't call it as a string because the engine doesn't know it's supposed to be a function. I seem to remember a way to use Eval() to handle that, but I may be just losing my mind instead. ;-} Charlotte -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Tuesday, June 23, 2009 8:39 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Pseudo Pointer to a Function I don't know why you couldn't pass the name of the function as a string???? Susan H.