> answer 1 - use evaluate
As a last resort, maybe.
// some basic functions
function f(){
return true;
}
function g(){
return false;
}
// now use a static name, fnToCall, to dynamically call
different functions
fnToCall = f; // "f" being the function we defined above
writeOutput(fnToCall()); // outputs "true";
fToCall = g;
writeOutput(fnToCall()); // now outputs "false";
Functions can be assigned to variables just like any other
value / variable
/ object.
> answer 2 - proably not,
Just "no, you can't". You need the song and dance. But if
it's the sort
of thing you're doing on a regular basis (can't think why you
would be, to
be honest), then you should write a UDF that does it, and the
you only have
to sing and dance once. Thereafter: use the UDF.
--
Adam