HBCMS更多的中文手册参考:

compareEndPoints Method

DHTML文档教程

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

dhtml语法

iresult = textrange.compareendpoints(stype, orange)

parameters

sType Required. Stringthat 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.
oRange Required. TextRange objectthat specifies the range to compare with the object.

Return Value

Integer. Returns爋ne 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:

  • Before the letter a.
  • Between the letters a and b.
  • Between the letters b and c.
  • After the letter c.

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-microsoft win32® platforms.

是否符合公共标准

There is no public standard that applies to this method.

Applies To

TextRange

更多语法参考

setEndPoint