question : a trick to call function from a variable - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: question : a trick to call function from a variable (/thread-7002.html) |
question : a trick to call function from a variable - primer - 10-08-2016 10:12 PM 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. RE: question : a trick to call function from a variable - StephenG1CMZ - 10-08-2016 11:09 PM I think EVAL(EXPR(call)) Or perhaps just EXPR(call) Will do what you want. RE: question : a trick to call function from a variable - primer - 10-09-2016 11:14 AM 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) |