TE Edit Control Java / HTML-JavaScript Help
Product page

TerLocateField

Locate a data field.

boolean TerLocateField(location,name, exact, repaint)
int location;Use one of the following constants:
TER_FIRST:Search from the top of the file and locate the first occurrence of the field.
TER_LAST:Search from the bottom of the file and locate the last occurrence of the field.
TER_NEXT:Find the next occurrence of the field.
TER_PREV:Find the previous occurrence of the field.
String name:Field name to search for.
boolean exact:Set to true to match the field names in the document exactly to the field name given by the 'name' parameter. Set to false to match only the length of the name parameter. Consider a document containing two fields 'company1' and 'company2'. If the name parameter is set to 'company' and the 'exact' parameter is set to false, then both the fields will be matched.

To match any field name, set the 'name' argument to "" and the 'exact' argument to false.

boolean repaint:Set to true to repaint the screen after this operation.

Please note that the repaint operation can change the cursor position to adjust for any invisible text in the line. Therefore, the 'repaint' parameter should be set to false if your application relies on the cursor position set by this function for subsequent APIs.

Return Value: This function returns a true value when successful. When successful, it positions the cursor on the field name.