Apps脚本自定义功能 - 内部错误 [英] Apps Script Custom Function- Internal Error

查看:77
本文介绍了Apps脚本自定义功能 - 内部错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用Apps Script进行游戏。我打开了一个新的电子表格,访问了脚本编辑器,并编写了下面这个简单的函数:

pre $函数DOUBLES(num){
返回num * 2;
}

然后我保存了脚本,刷新了我的浏览器并在一个单元格中使用了我的函数:

  = DOUBLES(1)

正确答案(2)出现在单元格中,所以我用2替换了我的1个参数。这就是奇怪的地方。在更改所述参数后,我得到了一个#ERROR答案:执行自定义函数的内部错误。但是,当我将参数更改回1时,错误仍然存​​在。那么,当我决定再次尝试2时,我得到了正确的4回应。经过多次尝试,刷新/替换我的电子表格,以及抓我的头部这么多我都离开战壕,我不确定为什么我的功能只能工作30-50%的时间。我尝试了其他单元格,其他参数号码等。这似乎是我最终会得到答案还是错误的折腾。

解决方案

在处理Google Apps脚本自定义功能中似乎存在最近引入的一个错误。



这显然是< href =https://code.google.com/p/google-apps-script-issues/issues/detail?id=5222 =nofollow> Issue 5222 。 (我说显然是因为这个问题报告并不是很清楚,但是已经足够好了)。为了获得更多的关注并获得更新,请加注明。


I've just started playing around with Apps Script. I opened a new spreadsheet, accessed the script editor, and wrote the following simple function:

function DOUBLES(num) {
  return num * 2;
}

I then saved the script, refreshed my browser and used my function in a cell:

=DOUBLES(1)

The correct answer (2) appeared in the cell, so I replaced my 1 argument with a 2. This is where it gets weird. Upon changing said argument, I got an #ERROR answer: "Internal error executing the custom function." When I changed the argument back to a 1, however, the error persisted. THEN, when I decided to try 2 again, I got the correct 4 response. Having tried this multiple times, refreshing/replacing my spreadsheet, and scratching my head so much I'm leaving trenches, I'm unsure as to why my function only appears to work 30-50% of the time. I've tried other cells, other argument numbers, etc. It seems a toss-up as to whether I'll end up with an answer or an error.

解决方案

There appears to be a recently-introduced bug in the handling of Google Apps Script custom functions.

This is apparently the subject of Issue 5222. (I say "apparently" because that issue report isn't really clear. But good enough.) Star it to get more attention on it, and to receive updates.

这篇关于Apps脚本自定义功能 - 内部错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆