我一直在研究脚本,并添加了一条if语句,现在它生成错误“非法形成的XML语法”。我在if语句上尝试了各种变体,但无法使其正常工作。该错误始终指向脚本的最后一行,特别是}括号。
function readable() {
var roundTotal = 95
var readable
var score1 = "String1";
var score2 = "String2";
var score3 = "String3";
var score4 = "String4";
var score5 = "String5";
var score6 = "String6";
var score7 = "String7";
if (roundTotal =< 100 && => 90) {readable = score1}
else if (roundTotal =< 89 && => 80) {readable = score2}
else if (roundTotal =< 79 && => 70) {readable = score3}
else if (roundTotal =< 69 && => 60) {readable = score4}
else if (roundTotal =< 69 && => 50) {readable = score5}
else if (roundTotal =< 49 && => 30) {readable = score6}
else if (roundTotal =< 29 && => 0) {readable = score7}
DocumentApp.getUi().alert('Your Flesch Kinkaid Score is ' + readable + '');
}
最佳答案
大于或等于>=
不是=>
,类似地是<=
不是=<
。