jeudi 3 septembre 2015

Executing IF when one of the conditions is FALSE

This code is running inside an Apps Script for a Google Sheet and I cannot for the life of me work out why the code inside this IF statement executes. The log inside the IF statement executes tells me that the condition is returning FALSE yet still it executes.

if (!entrySheet.getRange('B6').isBlank() && !entrySheet.getRange('L6').isBlank()); {
  var testMobile = !entrySheet.getRange('B6').isBlank() && !entrySheet.getRange('L6').isBlank();
  Logger.log('Row 17 executes ' + testMobile); <-- Shows FALSE
  clientDataSheet.getRange(entrySheet.getRange('L6').getValue(), 2).setValue(entrySheet.getRange('B6').getValue()); <-- This line returns the error code
}

The added strangeness is that an error code is returned at the last line, "The coordinates or dimensions of the range are invalid."

Aucun commentaire:

Enregistrer un commentaire