evesely
23rd October 2002, 19:17
Is there a nice way to write a generic function that calls other functions in the same program script based upon a string that is passed? This would be similar to the way in which on.old.occ(function) works.
For example, I have a wrapper function (let's call it wrapper()) that takes a string value. It does some processing and then calls the function indicated by the string. Let's say I have functions a(), b(), and c(). I would like to be able to call wrapper("a") and have the wrapper function launch function a().
I have thought about the load_dll, exec_function, ... functions, but I don't know if they are appropriate here since I am working within only one program script.
Thoughts?
For example, I have a wrapper function (let's call it wrapper()) that takes a string value. It does some processing and then calls the function indicated by the string. Let's say I have functions a(), b(), and c(). I would like to be able to call wrapper("a") and have the wrapper function launch function a().
I have thought about the load_dll, exec_function, ... functions, but I don't know if they are appropriate here since I am working within only one program script.
Thoughts?