Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google apps script &引用;(缺失)在条件之后。”;_Google Apps Script - Fatal编程技术网

Google apps script &引用;(缺失)在条件之后。”;

Google apps script &引用;(缺失)在条件之后。”;,google-apps-script,Google Apps Script,我是编写代码的初学者,实际上这是我的第一个代码。我的问题是这个消息“失踪后的条件。”。我什么都试了,但都没用,请有人帮帮我 var calendar = sheet.getRange("B4:H9"); var arr1 = [calendar.getCell(r = 0, c = 0).getValue]; var interval = sheet.getRange("B13:B"); var arr2 = [interval.getCell(rr = 0, 0).getValu

我是编写代码的初学者,实际上这是我的第一个代码。我的问题是这个消息“失踪后的条件。”。我什么都试了,但都没用,请有人帮帮我

var calendar = sheet.getRange("B4:H9");
  var arr1 = [calendar.getCell(r = 0, c = 0).getValue];

  var interval = sheet.getRange("B13:B");
  var arr2 = [interval.getCell(rr = 0, 0).getValue];

  for(r; r < arr1.length; r++)
  {
    for(c; c < arr1.leangth[r]; c++)
    {
      for(rr; rr < dia.leangth[0]; rr++)
      {
        if(calendar.getCell(r,c).getValue() === interval.getCell(rr,0)getValue()) //<---Here is the Problem
        {
          arr1.getCell(r,c).setBackground('Blue');
        }
      }
    }
  }
}
var calendar=sheet.getRange(“B4:H9”);
var arr1=[calendar.getCell(r=0,c=0.getValue];
var区间=sheet.getRange(“B13:B”);
var arr2=[interval.getCell(rr=0,0.getValue];
对于(r;r如果(calendar.getCell(r,c).getValue()==interval.getCell(rr,0)getValue())/则出现的错误是因为在调用
.getValue()
函数之前没有添加

因此,您应该将代码行更新为:

if(calendar.getCell(r,c).getValue() === interval.getCell(rr,0).getValue())
此外,以下是一些可能对您有所帮助的链接:

  • )

  • )

  • getCell(rr,0)getValue()
    我认为您缺少了一些东西;)