albatross68
Programmer
I was thinking of creating dynamic menus.
In my scenario, there a table where each record is a menu entry. It has a parent (to create a hierarchy) and an action.
The action may be:
- display a sub-menu (implemented using the table itself)
- run an external command (RUN a string)
- run an internal function (i.e. open a form to updete a customer)
The last one is a problem. Even assuming that all the functions that can be called by a menu item use the same calling convention (i.e. no parameters). I do not know how to call them. The menu table will probably contain the function's name, but I can't use
I thought of writing a "dispatcher" function, but this would be long an would require update with each new form/report I create.
I was hoping there was a way I could dynamically call the function using its name. I am open to any ideas of how to do this more efficiently than by writing the "dispatcher
In my scenario, there a table where each record is a menu entry. It has a parent (to create a hierarchy) and an action.
The action may be:
- display a sub-menu (implemented using the table itself)
- run an external command (RUN a string)
- run an internal function (i.e. open a form to updete a customer)
The last one is a problem. Even assuming that all the functions that can be called by a menu item use the same calling convention (i.e. no parameters). I do not know how to call them. The menu table will probably contain the function's name, but I can't use
Code:
CALL <variablename>
I was hoping there was a way I could dynamically call the function using its name. I am open to any ideas of how to do this more efficiently than by writing the "dispatcher