2017-08-09 97 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 
 
}