Click to return to the DHTML, HTML     
collapse Method     componentFromPoint Method     DHTML Methods    
Web Workshop  |  DHTML, HTML & CSS

compareEndPoints Method


Compares an end point of a TextRange object with an end point of another range.

Syntax

iResult = TextRange.compareEndPoints(sType, oRange)

Parameters

sTypeRequired. String that specifies one of the following values:
StartToEndCompare the start of the TextRange object with the end of the oRange parameter.
StartToStartCompare the start of the TextRange object with the start of the oRange parameter.
EndToStartCompare the end of the TextRange object with the start of the oRange parameter.
EndToEndCompare the end of the TextRange object with the end of the oRange parameter.
oRangeRequired. TextRange object that specifies the range to compare with the object.

Return Value

Integer. Returns one of the following possible values:

-1The end point of the object is further to the left than the end point of oRange.
0The end point of the object is at the same location as the end point of oRange.
1The end point of the object is further to the right than the end point of oRange.

Remarks

A text range has two end points. One end point is located at the beginning of the text range, and the other is located at the end of the text range. An end point also can be characterized as the position between two characters in an HTML document.

As of Microsoft® Internet Explorer 4.0, an end point is relative to text only, not HTML tags.

There are four possible end points in the following HTML:

<BODY><P><B>abc

The possible end points are:

As of Internet Explorer 4.0, an end point cannot be established between the BODY and the P. Such an end point is considered to be located before the letter a.

This method might not be available on non-Win32® platforms. For the latest information about Internet Explorer cross-platform compatibility, see article Q172976 Non-MSDN link in the Microsoft Knowledge Base.

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:

TextRange



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.