2017-08-09 100 views
0

我敢肯定这是一个愚蠢的问题,但我无法在任何地方找到答案。在Apps脚本中,是否有与VBA“呼叫”命令等价的功能?我想从另一个Function中调用一个Function,通过名称作为一个字符串。相当于“呼叫”命令

function ClearFields(){ 
calc.getRange('A3:C15').clearContent() 
"Call" function example1 
} 
+3

你只是把它像这样'例1()'。使用'call'来调用函数只是VBA所具有的一个怪癖。如果是VBA,甚至不需要你的情况。 https://msdn.microsoft.com/en-us/vba/language-reference-vba/articles/call-statement – litelite

+0

谢谢,我知道它必须是简单的东西。 – Plaidpenguinhat

回答

0

function example1(){ 
 
calc.getRange('G3:G15').clearContent() 
 

 
} 
 

 

 
function ClearFields(){ 
 
calc.getRange('A3:C15').clearContent() 
 
example1(); // This will execute the function 
 
}