question : a trick to call function from a variable
|
10-08-2016, 10:12 PM
Post: #1
|
|||
|
|||
question : a trick to call function from a variable
hello,
I have a function name in a variable, and I would like to call it, some one know how to do ? example : Code:
But it does not works as I wanted : it returns "myfct(123)" but does not execute it... if someone can help me.. Thank you. primer |
|||
10-08-2016, 11:09 PM
Post: #2
|
|||
|
|||
RE: question : a trick to call function from a variable
I think
EVAL(EXPR(call)) Or perhaps just EXPR(call) Will do what you want. Stephen Lewkowicz (G1CMZ) https://my.numworks.com/python/steveg1cmz |
|||
10-09-2016, 11:14 AM
Post: #3
|
|||
|
|||
RE: question : a trick to call function from a variable
Hi StephenG1CMZ,
Thank you very much, it's OK. By the way, a note for thoses who may want to use such callback trick : if you want to use string as function parameters, you have to protect them with backslashs (\"). For example par2 accept string abcd Code: EXPORT myfct(par1, par2) primer |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)