TE Edit Control Java / HTML-JavaScript Help
Product page

TerGetTagPos

Get the text position of a tag.

int TerGetTagPos(TagId, name, type)
boolean TerGetTagPos2(TagId, name, type)
int type; Tag type (used by the TerPosTagEx function only):
TERTAG_BKM:Bookmark tag
TERTAG_USER: Generic tag
int TagId;The tag id to search for. This parameter is ignored if the 'name' parameter is specified.
String name;The tag name to search for. Please note that tag names are not unique within a document.

Upon a successful return from the TerGetTagPos2 method, the following information can be retrieved by using TerGetOutInt methods:

int line;

The line number where the tag is located.

This parameter is used by the TerGetTagPos2 method only. Upon a successful return from this method, the line value can be retrieve as following:

line=tej.TerGetOutInt("Line")
int col;

The column number where the tag is located.

This parameter is used by the TerGetTagPos2 method only. Upon a successful return from this method, the column value can be retrieve as following:

col=tej.TerGetOutInt("Col")

Return Value: The TerGetTagPos method searches the given tag to return the absolute character position of the tag. The function returns -1 if the tag is not found in the document.

The TerGetTagPos2 method searches the given tag to return the line/column position of the tag. The function returns a false value if the tag is not found in the document.