asp.net.ph

Skip Navigation Links

compareEndPoints Method

DHTML Methods


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

Syntax

iResult = TextRange.compareEndPoints ( sType, oRange ) 
Parameters

sType Required. Value that describes which end point on the object range and which end point on oRange are to be compared. This can be one of these values:

StartToEnd Compare the start of the TextRange object with the end of the TextRange parameter.
StartToStart Compare the start of the TextRange object with the start of the TextRange parameter.
EndToStart Compare the end of the TextRange object with the start of the TextRange parameter.
EndToEnd Compare the end of the TextRange object with the end of the TextRange parameter.

oRange Required. TextRange object specifying the range to compare to the object.

Return Value

Integer. Possible return values include:

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

Remarks

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

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

There are four possible end point locations in the following HTML:

<body><p><b>abc

Possible end point locations include:

  • Before the 'a'
  • Between the 'a' and the 'b'
  • Between the 'b' and the 'c'
  • After the 'c'

In Internet Explorer® 4.0, an end point cannot be established between the BODY and the P, for example. Such an end point would be considered before the 'a'.

This method might not be available on non-Win32® platforms. See the Microsoft® Knowledge Base for the latest information on Internet Explorer® cross-platform compatibility.

Applies To

TextRange



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note