This object is used in various places to indicate a region within the editor. To better visualize how this works, imagine a rectangle. Each quadrant of the rectangle is analogus to a range, as ranges contain a starting row and starting column, and an ending row, and ending column.

Constructors

Creates a new Range object with the given starting and ending row and column points.

Creates a new Range object with the given starting and ending row and column points.

Arguments

startRowNumber

Required. The starting row

startColumnNumber

Required. The starting column

endRowNumber

Required. The ending row

endColumnNumber

Required. The ending column

Methods

Returns the part of the current Range that occurs within the boundaries of firstRow and lastRow as a new Range object.

Returns the part of the current Range that occurs within the boundaries of firstRow and lastRow as a new Range object.

Arguments

firstRowNumber

Required. The starting row

lastRowNumber

Required. The ending row

Returns a duplicate of the calling range.

Returns a duplicate of the calling range.

    • Range.collapseRows()

    Returns a range containing the starting and ending rows of the original range, but with a column value of 0.

    Returns a range containing the starting and ending rows of the original range, but with a column value of 0.

    Checks the row and column points with the row and column points of the calling range.

    Checks the row and column points with the row and column points of the calling range.

    Arguments

    rowNumber

    Required. A row point to compare with

    columnNumber

    Required. A column point to compare with

    Returns

    Number

    This method returns one of the following numbers:

      • 0 if the two points are exactly equal
      • -1 if p.row is less then the calling range
      • 1 if p.row is greater than the calling range

    • If the starting row of the calling range is equal to p.row, and:

      • p.column is greater than or equal to the calling range's starting column, this returns 0
      • Otherwise, it returns -1

    • If the ending row of the calling range is equal to p.row, and:

      • p.column is less than or equal to the calling range's ending column, this returns 0
      • Otherwise, it returns 1

    Checks the row and column points with the row and column points of the calling range.

    Checks the row and column points with the row and column points of the calling range.

    Arguments

    rowNumber

    Required. A row point to compare with

    columnNumber

    Required. A column point to compare with

    Returns

    Number

    This method returns one of the following numbers:

      • 0 if the two points are exactly equal
      • -1 if p.row is less then the calling range
      • 1 if p.row is greater than the calling range, or if isEnd is `true.

    • If the starting row of the calling range is equal to p.row, and:

      • p.column is greater than or equal to the calling range's starting column, this returns 0
      • Otherwise, it returns -1

      *

    • If the ending row of the calling range is equal to p.row, and:

      • p.column is less than or equal to the calling range's ending column, this returns 0
      • Otherwise, it returns 1

    Checks the row and column points with the row and column points of the calling range.

    Checks the row and column points with the row and column points of the calling range.

    Arguments

    rowNumber

    Required. A row point to compare with

    columnNumber

    Required. A column point to compare with

    Returns

    Number

    This method returns one of the following numbers:

      • 1 if the ending row of the calling range is equal to row, and the ending column of the calling range is equal to column
      • -1 if the starting row of the calling range is equal to row, and the starting column of the calling range is equal to column

    • Otherwise, it returns the value after calling compare().

    Checks the row and column points of p with the row and column points of the calling range.

    Checks the row and column points of p with the row and column points of the calling range.

    Arguments

    pRange

    Required. A point to compare with

    Returns

    Number

    This method returns one of the following numbers:

      • 0 if the two points are exactly equal
      • -1 if p.row is less then the calling range
      • 1 if p.row is greater than the calling range

    • If the starting row of the calling range is equal to p.row, and:

      • p.column is greater than or equal to the calling range's starting column, this returns 0
      • Otherwise, it returns -1

      *

    • If the ending row of the calling range is equal to p.row, and:

      • p.column is less than or equal to the calling range's ending column, this returns 0
      • Otherwise, it returns 1

    Compares this range (A) with another range (B).

    Compares this range (A) with another range (B).

    Arguments

    rangeRange

    Required. A range to compare with

    Returns

    Number

    This method returns one of the following numbers:


      • -2: (B) is in front of (A), and doesn't intersect with (A)
      • -1: (B) begins before (A) but ends inside of (A)
      • 0: (B) is completely inside of (A) OR (A) is completely inside of (B)
      • +1: (B) begins inside of (A) but ends outside of (A)
      • +2: (B) is after (A) and doesn't intersect with (A)
      • 42: FTW state: (B) ends in (A) but starts outside of (A)

    Checks the row and column points with the row and column points of the calling range.

    Checks the row and column points with the row and column points of the calling range.

    Arguments

    rowNumber

    Required. A row point to compare with

    columnNumber

    Required. A column point to compare with

    Returns

    Number

    This method returns one of the following numbers:


      • 0 if the two points are exactly equal
      • -1 if p.row is less then the calling range
      • 1 if p.row is greater than the calling range, or if isStart is true.

    • If the starting row of the calling range is equal to p.row, and:

      • p.column is greater than or equal to the calling range's starting column, this returns 0
      • Otherwise, it returns -1

    • If the ending row of the calling range is equal to p.row, and:

      • p.column is less than or equal to the calling range's ending column, this returns 0
      • Otherwise, it returns 1

    Returns true if the row and column provided are within the given range. This can better be expressed as returning true if:

    Returns true if the row and column provided are within the given range. This can better be expressed as returning true if:

    this.start.row <= row <= this.end.row && this.start.column <= column <= this.end.column

    Arguments

    rowNumber

    Required. A row to check for

    columnNumber

    Required. A column to check for

    Checks the start and end points of range and compares them to the calling range. Returns true if the range is contained within the caller's range.

    Checks the start and end points of range and compares them to the calling range. Returns true if the range is contained within the caller's range.

    Arguments

    rangeRange

    Required. A range to compare with

    Changes the row and column points for the calling range for both the starting and ending points. This method returns that range with a new row.

    Changes the row and column points for the calling range for both the starting and ending points. This method returns that range with a new row.

    Arguments

    rowNumber

    Required. A new row to extend to

    columnNumber

    Required. A new column to extend to

    Creates and returns a new Range based on the row and column of the given parameters.

    Creates and returns a new Range based on the row and column of the given parameters.

    Arguments

    startRange

    Required. A starting point to use

    endRange

    Required. An ending point to use

    Returns true if the row and column are within the given range.

    Returns true if the row and column are within the given range.

    Arguments

    rowNumber

    Required. A row point to compare with

    columnNumber

    Required. A column point to compare with

    Returns true if the row and column are within the given range's ending points.

    Returns true if the row and column are within the given range's ending points.

    Arguments

    rowNumber

    Required. A row point to compare with

    columnNumber

    Required. A column point to compare with

    Returns true if the row and column are within the given range's starting points.

    Returns true if the row and column are within the given range's starting points.

    Arguments

    rowNumber

    Required. A row point to compare with

    columnNumber

    Required. A column point to compare with

    Returns true if passed in range intersects with the one calling this method.

    Returns true if passed in range intersects with the one calling this method.

    Arguments

    rangeRange

    Required. A range to compare with

    Returns true if the caller's ending row point is the same as row, and if the caller's ending column is the same as column.

    Returns true if the caller's ending row point is the same as row, and if the caller's ending column is the same as column.

    Arguments

    rowNumber

    Required. A row point to compare with

    columnNumber

    Required. A column point to compare with

    Returns true if and only if the starting row and column, and ending tow and column, are equivalent to those given by range.

    Returns true if and only if the starting row and column, and ending tow and column, are equivalent to those given by range.

    Arguments

    rangeRange

    Required. A range to check against

    Returns true if the range spans across multiple lines.

    Returns true if the range spans across multiple lines.

    Returns true if the caller's starting row point is the same as row, and if the caller's starting column is the same as column.

    Returns true if the caller's starting row point is the same as row, and if the caller's starting column is the same as column.

    Arguments

    rowNumber

    Required. A row point to compare with

    columnNumber

    Required. A column point to compare with

    Sets the starting row and column for the range.

    Sets the starting row and column for the range.

    Arguments

    rowNumber

    Required. A row point to set

    columnNumber

    Required. A column point to set

    Sets the starting row and column for the range.

    Sets the starting row and column for the range.

    Arguments

    rowNumber

    Required. A row point to set

    columnNumber

    Required. A column point to set

    Given the current Range, this function converts those starting and ending points into screen positions, and then returns a new Range object.

    Given the current Range, this function converts those starting and ending points into screen positions, and then returns a new Range object.

    Arguments

    sessionEditSession

    Required. The EditSession to retrieve coordinates from

    Returns a string containing the range's row and column information, given like this:

    Returns a string containing the range's row and column information, given like this:

    [start.row/start.column] -> [end.row/end.column]