dynamically build call to a function

J

JT

what is the correct way to dynamically build a call to a function in asp? i
have the name of the function i want to call in a dictionary object, this
works to execute the function but the output_value variable does not get
set. any ideas??

functionString = d.Item("create_contract_function_name") 'set variable for
the create contract function name that was retrieved
functionString = "output_value = " & functionString & "(param1, param2)"

Execute functionString
 
L

Lance Wynn

Would this work (I haven't tested)?

functionString = d.Item("create_contract_function_name") 'set variable for
the create contract function name that was retrieved
functionString = functionString & "(param1, param2)"

output_value=Execute(functionString)



what is the correct way to dynamically build a call to a function in asp? i
have the name of the function i want to call in a dictionary object, this
works to execute the function but the output_value variable does not get
set. any ideas??

functionString = d.Item("create_contract_function_name") 'set variable for
the create contract function name that was retrieved
functionString = "output_value = " & functionString & "(param1, param2)"

Execute functionString
 
J

JT

i tried that i got a type mismatch error - so i guess you have to execute
the whole thing in one shot..

jt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,156
Messages
2,570,878
Members
47,413
Latest member
KeiraLight

Latest Threads

Top