In an ash script I want to call a function previously defined in the script. However, I have the name of the function in a string. Is there a way - possibly using call - to do this? A rough pseudo code example of my intent:
void funcA() {
print("funcA");
}
void funcB() {
print("funcB");
}
string toCall = "";
if (decision()) {
toCall = "funcA";
} else {
toCall = "funcB";
}
call( toCall );
void funcA() {
print("funcA");
}
void funcB() {
print("funcB");
}
string toCall = "";
if (decision()) {
toCall = "funcA";
} else {
toCall = "funcB";
}
call( toCall );