TE Edit Control Java / HTML-JavaScript Help
Product page

TerGetLine

Retrieve a text line.

int TerGetLine( LineNo)
int LineNo;line number (0 to TotalLines - 1) to retrieve.

Description: This routine is used to retrieve the text and the font ids for a specified line. The 'font' variable receives an array of font ids. You can get further information about each font id by calling the 'GetFontInfo' function.

Return Value: This function returns the length of the retrieved line. This function return -1 if an error is encountered or when the 'LineNo' exceeds the total lines in the windows. The line text and the associated font array can be retrieved using the TerGetOutIntArray method.

C# Example:

  String text;
  int[] font;
  int len;
  ' Get the text and font ids
if (TerGetLine(LineNo)>0) {
     text=tej.TerGetOutStrArray("text"); // get the line text.
     font=tej.TerGetOutIntArray("FontArray"); // get the  
                     // integer array from the previous call to
                     // TerGetLine method
}  

There is one font-id associated with each character on the line. Therefore the string length of the line-text would be the same as the length of the font id array.