import { Array } from "lib/Array.cms"; class Range { constructor(startRow, startColumn, numRows, numColumns) { this.startRow = startRow; this.startColumn = startColumn; this.numRows = numRows; this.numColumns = numColumns; } getValues() { result = new Array(); for (y = this.startRow; y < this.startRow + this.numRows; y++) { row = new Array(); for (x = this.startColumn; x < this.startColumn + this.numColumns; x++) { row.push([x,y]); } result.push(row); } return result; } setValues(values) { for (y = 0; y < min(this.numRows - 1, values.length); y++) { row = values[y]; for (x = 0; x < min(this.numColumns - 1, row.length); x++) { [this.startColumn + x, this.startRow + y] = row[x]; } } } } function getDataRange() { return new Range(1, 1, Bottom, Right); }