Evaluate a string to run a function?
Posted: 09 Aug 2014 18:06
Hi,
is there a way of running a script from a string - so for example at right now, I'm just using if():
whereas I'd prefer to do:
is there a way of doing this?
Many thanks!
Rufus
is there a way of running a script from a string - so for example at right now, I'm just using if():
Code: Select all
if (x) { pgm1(); }
else if (y) { pgm2(); }
else if (z) { pgm3(); }
Code: Select all
evaluate('pgm' + currentPgm + '();');
Many thanks!
Rufus