<h1class="memberHeader"><spanclass="name">Range<spanclass="editInC9"><ahref='http://c9.io/open/git/?url=git%3A%2F%2Fgithub.com%2Fajaxorg%2Face.git'title='Edit in Cloud9 IDE'>[edit]</a></span></span>
<divclass="memberContent"><p>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.</p>
</div>
</div>
</article>
<h3class="sectionHeader">Constructors</h3>
<articleid="Range.new"data-title="new Range (constructor)"class="article">
<divid="ellipsis_new Range"class="ellipsis_description"><p>Creates a new <code>Range</code> object with the given starting and ending row and column points. ...</p>
</div>
<divid="short_new Range"class="short_description hiddenSpan"><p>Creates a new <code>Range</code> object with the given starting and ending row and column points.</p>
<divid="ellipsis_Range.clipRows"class="ellipsis_description"><p>Returns the part of the current <code>Range</code> that occurs within the boundaries of <code>firstRow</code> and <code>lastRow</code> as a new `Rang...</p>
</div>
<divid="short_Range.clipRows"class="short_description hiddenSpan"><p>Returns the part of the current <code>Range</code> that occurs within the boundaries of <code>firstRow</code> and <code>lastRow</code> as a new <code>Range</code> object.</p>
<divid="ellipsis_Range.collapseRows"class="ellipsis_description"><p>Returns a range containing the starting and ending rows of the original range, but with a column value of <code>0</code>. ...</p>
</div>
<divid="short_Range.collapseRows"class="short_description hiddenSpan"><p>Returns a range containing the starting and ending rows of the original range, but with a column value of <code>0</code>.</p>
<divid="ellipsis_Range.compare"class="ellipsis_description"><p>Checks the row and column points with the row and column points of the calling range. ...</p>
</div>
<divid="short_Range.compare"class="short_description hiddenSpan"><p>Checks the row and column points with the row and column points of the calling range.</p>
<h4>Arguments</h4><tableclass="argumentTable argument-list table table-striped table-bordered"><trclass="argumentRow "><tdclass="argName ">row</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A row point to compare with</td></tr><trclass="argumentRow "><tdclass="argName ">column</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A column point to compare with</td></tr></table>
<h4>Returns</h4><tableclass="returnTable return-list table table-striped table-bordered"><trclass=" "><tdclass="returnType "><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="returnDescription ">This method returns one of the following numbers:<br/><code>0</code> if the two points are exactly equal <br/><code>-1</code> if <code>p.row</code> is less then the calling range <br/><code>1</code> if <code>p.row</code> is greater than the calling range <br/><br/> If the starting row of the calling range is equal to <code>p.row</code>, and: <br/><code>p.column</code> is greater than or equal to the calling range's starting column, this returns <code>0</code><br/> Otherwise, it returns -1<br/><br/> If the ending row of the calling range is equal to <code>p.row</code>, and: <br/><code>p.column</code> is less than or equal to the calling range's ending column, this returns <code>0</code><br/> Otherwise, it returns 1</td></tr></table>
<divid="ellipsis_Range.compareEnd"class="ellipsis_description"><p>Checks the row and column points with the row and column points of the calling range. ...</p>
</div>
<divid="short_Range.compareEnd"class="short_description hiddenSpan"><p>Checks the row and column points with the row and column points of the calling range.</p>
<h4>Arguments</h4><tableclass="argumentTable argument-list table table-striped table-bordered"><trclass="argumentRow "><tdclass="argName ">row</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A row point to compare with</td></tr><trclass="argumentRow "><tdclass="argName ">column</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A column point to compare with</td></tr></table>
<h4>Returns</h4><tableclass="returnTable return-list table table-striped table-bordered"><trclass=" "><tdclass="returnType "><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="returnDescription ">This method returns one of the following numbers:<br/><code>0</code> if the two points are exactly equal<br/><code>-1</code> if <code>p.row</code> is less then the calling range<br/><code>1</code> if <code>p.row</code> is greater than the calling range, or if <code>isEnd</code> is <code>true.<br/><br/> If the starting row of the calling range is equal to </code>p.row<code>, and:<br/></code>p.column<code> is greater than or equal to the calling range's starting column, this returns </code>0<code><br/> Otherwise, it returns -1<br/><br/> If the ending row of the calling range is equal to </code>p.row<code>, and:<br/></code>p.column<code> is less than or equal to the calling range's ending column, this returns </code>0`<br/> Otherwise, it returns 1</td></tr></table>
<divid="ellipsis_Range.compareInside"class="ellipsis_description"><p>Checks the row and column points with the row and column points of the calling range. ...</p>
</div>
<divid="short_Range.compareInside"class="short_description hiddenSpan"><p>Checks the row and column points with the row and column points of the calling range.</p>
<h4>Arguments</h4><tableclass="argumentTable argument-list table table-striped table-bordered"><trclass="argumentRow "><tdclass="argName ">row</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A row point to compare with</td></tr><trclass="argumentRow "><tdclass="argName ">column</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A column point to compare with</td></tr></table>
<h4>Returns</h4><tableclass="returnTable return-list table table-striped table-bordered"><trclass=" "><tdclass="returnType "><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="returnDescription ">This method returns one of the following numbers:<br/><code>1</code> if the ending row of the calling range is equal to <code>row</code>, and the ending column of the calling range is equal to <code>column</code><br/><code>-1</code> if the starting row of the calling range is equal to <code>row</code>, and the starting column of the calling range is equal to <code>column</code><br/><br/> Otherwise, it returns the value after calling <ahref="#Range.compare"class="link-short"title="Range.compare (class method)"data-id="Range.compare">compare</a>.</td></tr></table>
<li><spanclass="label related-to">Related to <ahref="#Range.compare"class=""title="Range.compare (class method)"data-id="Range.compare">Range.compare</a></span></li>
</ul>
</li>
</ul>
</div>
<divclass="sideToggler">
<divid="ellipsis_Range.comparePoint"class="ellipsis_description"><p>Checks the row and column points of <code>p</code> with the row and column points of the calling range. ...</p>
</div>
<divid="short_Range.comparePoint"class="short_description hiddenSpan"><p>Checks the row and column points of <code>p</code> with the row and column points of the calling range.</p>
<h4>Arguments</h4><tableclass="argumentTable argument-list table table-striped table-bordered"><trclass="argumentRow "><tdclass="argName ">p</td><tdclass="argType""><ahref="#Range"class=""title="Range (class)"data-id="Range">Range</a></td><tdclass="argDescription ">Required. A point to compare with</td></tr></table>
<h4>Returns</h4><tableclass="returnTable return-list table table-striped table-bordered"><trclass=" "><tdclass="returnType "><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="returnDescription ">This method returns one of the following numbers:<br/><code>0</code> if the two points are exactly equal<br/><code>-1</code> if <code>p.row</code> is less then the calling range<br/><code>1</code> if <code>p.row</code> is greater than the calling range<br/><br/> If the starting row of the calling range is equal to <code>p.row</code>, and:<br/><code>p.column</code> is greater than or equal to the calling range's starting column, this returns <code>0</code><br/> Otherwise, it returns -1<br/><br/> If the ending row of the calling range is equal to <code>p.row</code>, and:<br/><code>p.column</code> is less than or equal to the calling range's ending column, this returns <code>0</code><br/> Otherwise, it returns 1<br/></td></tr></table>
<h4>Arguments</h4><tableclass="argumentTable argument-list table table-striped table-bordered"><trclass="argumentRow "><tdclass="argName ">range</td><tdclass="argType""><ahref="#Range"class=""title="Range (class)"data-id="Range">Range</a></td><tdclass="argDescription ">Required. A range to compare with</td></tr></table>
<h4>Returns</h4><tableclass="returnTable return-list table table-striped table-bordered"><trclass=" "><tdclass="returnType "><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="returnDescription ">This method returns one of the following numbers:<br/><br/><code>-2</code>: (B) is in front of (A), and doesn't intersect with (A)<br/><code>-1</code>: (B) begins before (A) but ends inside of (A)<br/><code>0</code>: (B) is completely inside of (A) OR (A) is completely inside of (B)<br/><code>+1</code>: (B) begins inside of (A) but ends outside of (A)<br/><code>+2</code>: (B) is after (A) and doesn't intersect with (A)<br/><code>42</code>: FTW state: (B) ends in (A) but starts outside of (A)</td></tr></table>
<divid="ellipsis_Range.compareStart"class="ellipsis_description"><p>Checks the row and column points with the row and column points of the calling range. ...</p>
</div>
<divid="short_Range.compareStart"class="short_description hiddenSpan"><p>Checks the row and column points with the row and column points of the calling range.</p>
<h4>Arguments</h4><tableclass="argumentTable argument-list table table-striped table-bordered"><trclass="argumentRow "><tdclass="argName ">row</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A row point to compare with</td></tr><trclass="argumentRow "><tdclass="argName ">column</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A column point to compare with</td></tr></table>
<h4>Returns</h4><tableclass="returnTable return-list table table-striped table-bordered"><trclass=" "><tdclass="returnType "><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="returnDescription ">This method returns one of the following numbers:<br/><br/><code>0</code> if the two points are exactly equal<br/><code>-1</code> if <code>p.row</code> is less then the calling range<br/><code>1</code> if <code>p.row</code> is greater than the calling range, or if <code>isStart</code> is <code>true</code>.<br/><br/> If the starting row of the calling range is equal to <code>p.row</code>, and:<br/><code>p.column</code> is greater than or equal to the calling range's starting column, this returns <code>0</code><br/> Otherwise, it returns -1<br/><br/> If the ending row of the calling range is equal to <code>p.row</code>, and:<br/><code>p.column</code> is less than or equal to the calling range's ending column, this returns <code>0</code><br/> Otherwise, it returns 1</td></tr></table>
<li><spanclass="label related-to">Related to <ahref="#Range.compare"class=""title="Range.compare (class method)"data-id="Range.compare">Range.compare</a></span></li>
</ul>
</li>
</ul>
</div>
<divclass="sideToggler">
<divid="ellipsis_Range.contains"class="ellipsis_description"><p>Returns <code>true</code> if the <code>row</code> and <code>column</code> provided are within the given range. This can better be expressed as return...</p>
</div>
<divid="short_Range.contains"class="short_description hiddenSpan"><p>Returns <code>true</code> if the <code>row</code> and <code>column</code> provided are within the given range. This can better be expressed as returning <code>true</code> if:
<li><spanclass="label related-to">Related to <ahref="#Range.comparePoint"class=""title="Range.comparePoint (class method)"data-id="Range.comparePoint">Range.comparePoint</a></span></li>
</ul>
</li>
</ul>
</div>
<divclass="sideToggler">
<divid="ellipsis_Range.containsRange"class="ellipsis_description"><p>Checks the start and end points of <code>range</code> and compares them to the calling range. Returns <code>true</code> if the <code>range</code> is ...</p>
</div>
<divid="short_Range.containsRange"class="short_description hiddenSpan"><p>Checks the start and end points of <code>range</code> and compares them to the calling range. Returns <code>true</code> if the <code>range</code> is contained within the caller's range.</p>
<h4>Arguments</h4><tableclass="argumentTable argument-list table table-striped table-bordered"><trclass="argumentRow "><tdclass="argName ">range</td><tdclass="argType""><ahref="#Range"class=""title="Range (class)"data-id="Range">Range</a></td><tdclass="argDescription ">Required. A range to compare with</td></tr></table>
<divid="ellipsis_Range.extend"class="ellipsis_description"><p>Changes the row and column points for the calling range for both the starting and ending points. This method returns...</p>
</div>
<divid="short_Range.extend"class="short_description hiddenSpan"><p>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.</p>
<h4>Arguments</h4><tableclass="argumentTable argument-list table table-striped table-bordered"><trclass="argumentRow "><tdclass="argName ">row</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A new row to extend to</td></tr><trclass="argumentRow "><tdclass="argName ">column</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A new column to extend to</td></tr></table>
<divid="ellipsis_Range.fromPoints"class="ellipsis_description"><p>Creates and returns a new <code>Range</code> based on the row and column of the given parameters. ...</p>
</div>
<divid="short_Range.fromPoints"class="short_description hiddenSpan"><p>Creates and returns a new <code>Range</code> based on the row and column of the given parameters.</p>
<h4>Arguments</h4><tableclass="argumentTable argument-list table table-striped table-bordered"><trclass="argumentRow "><tdclass="argName ">start</td><tdclass="argType""><ahref="#Range"class=""title="Range (class)"data-id="Range">Range</a></td><tdclass="argDescription ">Required. A starting point to use</td></tr><trclass="argumentRow "><tdclass="argName ">end</td><tdclass="argType""><ahref="#Range"class=""title="Range (class)"data-id="Range">Range</a></td><tdclass="argDescription ">Required. An ending point to use</td></tr></table>
<li><spanclass="label related-to">Related to <ahref="#Range.compare"class=""title="Range.compare (class method)"data-id="Range.compare">Range.compare</a></span></li>
</ul>
</li>
</ul>
</div>
<divclass="sideToggler">
<divid="ellipsis_Range.inside"class="ellipsis_description"><p>Returns <code>true</code> if the <code>row</code> and <code>column</code> are within the given range. ...</p>
</div>
<divid="short_Range.inside"class="short_description hiddenSpan"><p>Returns <code>true</code> if the <code>row</code> and <code>column</code> are within the given range.</p>
<h4>Arguments</h4><tableclass="argumentTable argument-list table table-striped table-bordered"><trclass="argumentRow "><tdclass="argName ">row</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A row point to compare with</td></tr><trclass="argumentRow "><tdclass="argName ">column</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A column point to compare with</td></tr></table>
<li><spanclass="label related-to">Related to <ahref="#Range.compare"class=""title="Range.compare (class method)"data-id="Range.compare">Range.compare</a></span></li>
</ul>
</li>
</ul>
</div>
<divclass="sideToggler">
<divid="ellipsis_Range.insideEnd"class="ellipsis_description"><p>Returns <code>true</code> if the <code>row</code> and <code>column</code> are within the given range's ending points. ...</p>
</div>
<divid="short_Range.insideEnd"class="short_description hiddenSpan"><p>Returns <code>true</code> if the <code>row</code> and <code>column</code> are within the given range's ending points.</p>
<h4>Arguments</h4><tableclass="argumentTable argument-list table table-striped table-bordered"><trclass="argumentRow "><tdclass="argName ">row</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A row point to compare with</td></tr><trclass="argumentRow "><tdclass="argName ">column</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A column point to compare with</td></tr></table>
<li><spanclass="label related-to">Related to <ahref="#Range.compare"class=""title="Range.compare (class method)"data-id="Range.compare">Range.compare</a></span></li>
</ul>
</li>
</ul>
</div>
<divclass="sideToggler">
<divid="ellipsis_Range.insideStart"class="ellipsis_description"><p>Returns <code>true</code> if the <code>row</code> and <code>column</code> are within the given range's starting points. ...</p>
</div>
<divid="short_Range.insideStart"class="short_description hiddenSpan"><p>Returns <code>true</code> if the <code>row</code> and <code>column</code> are within the given range's starting points.</p>
<h4>Arguments</h4><tableclass="argumentTable argument-list table table-striped table-bordered"><trclass="argumentRow "><tdclass="argName ">row</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A row point to compare with</td></tr><trclass="argumentRow "><tdclass="argName ">column</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A column point to compare with</td></tr></table>
<divid="ellipsis_Range.intersects"class="ellipsis_description"><p>Returns <code>true</code> if passed in <code>range</code> intersects with the one calling this method. ...</p>
</div>
<divid="short_Range.intersects"class="short_description hiddenSpan"><p>Returns <code>true</code> if passed in <code>range</code> intersects with the one calling this method.</p>
<h4>Arguments</h4><tableclass="argumentTable argument-list table table-striped table-bordered"><trclass="argumentRow "><tdclass="argName ">range</td><tdclass="argType""><ahref="#Range"class=""title="Range (class)"data-id="Range">Range</a></td><tdclass="argDescription ">Required. A range to compare with</td></tr></table>
<divid="ellipsis_Range.isEnd"class="ellipsis_description"><p>Returns <code>true</code> if the caller's ending row point is the same as <code>row</code>, and if the caller's ending column is the same ...</p>
</div>
<divid="short_Range.isEnd"class="short_description hiddenSpan"><p>Returns <code>true</code> if the caller's ending row point is the same as <code>row</code>, and if the caller's ending column is the same as <code>column</code>.</p>
<h4>Arguments</h4><tableclass="argumentTable argument-list table table-striped table-bordered"><trclass="argumentRow "><tdclass="argName ">row</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A row point to compare with</td></tr><trclass="argumentRow "><tdclass="argName ">column</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A column point to compare with</td></tr></table>
<divid="ellipsis_Range.isEqual"class="ellipsis_description"><p>Returns <code>true</code> if and only if the starting row and column, and ending tow and column, are equivalent to those given ...</p>
</div>
<divid="short_Range.isEqual"class="short_description hiddenSpan"><p>Returns <code>true</code> if and only if the starting row and column, and ending tow and column, are equivalent to those given by <code>range</code>.</p>
<h4>Arguments</h4><tableclass="argumentTable argument-list table table-striped table-bordered"><trclass="argumentRow "><tdclass="argName ">range</td><tdclass="argType""><ahref="#Range"class=""title="Range (class)"data-id="Range">Range</a></td><tdclass="argDescription ">Required. A range to check against</td></tr></table>
<divid="ellipsis_Range.isStart"class="ellipsis_description"><p>Returns <code>true</code> if the caller's starting row point is the same as <code>row</code>, and if the caller's starting column is the s...</p>
</div>
<divid="short_Range.isStart"class="short_description hiddenSpan"><p>Returns <code>true</code> if the caller's starting row point is the same as <code>row</code>, and if the caller's starting column is the same as <code>column</code>.</p>
<h4>Arguments</h4><tableclass="argumentTable argument-list table table-striped table-bordered"><trclass="argumentRow "><tdclass="argName ">row</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A row point to compare with</td></tr><trclass="argumentRow "><tdclass="argName ">column</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A column point to compare with</td></tr></table>
<h4>Arguments</h4><tableclass="argumentTable argument-list table table-striped table-bordered"><trclass="argumentRow "><tdclass="argName ">row</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A row point to set</td></tr><trclass="argumentRow "><tdclass="argName ">column</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A column point to set</td></tr></table>
<h4>Arguments</h4><tableclass="argumentTable argument-list table table-striped table-bordered"><trclass="argumentRow "><tdclass="argName ">row</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A row point to set</td></tr><trclass="argumentRow "><tdclass="argName ">column</td><tdclass="argType""><ahref="http://www.nodemanual.org/latest/js_doc/Number.html"class=""title="Number"data-id="Number">Number</a></td><tdclass="argDescription ">Required. A column point to set</td></tr></table>
<divid="ellipsis_Range.toScreenRange"class="ellipsis_description"><p>Given the current <code>Range</code>, this function converts those starting and ending points into screen positions, and then r...</p>
</div>
<divid="short_Range.toScreenRange"class="short_description hiddenSpan"><p>Given the current <code>Range</code>, this function converts those starting and ending points into screen positions, and then returns a new <code>Range</code> object.</p>
<divid="ellipsis_Range.toString"class="ellipsis_description"><p>Returns a string containing the range's row and column information, given like this:
...</p>
</div>
<divid="short_Range.toString"class="short_description hiddenSpan"><p>Returns a string containing the range's row and column information, given like this: