GetText Function (JavaJFCTextField)




Returns the text of the text field.


sText = object.GetText ([iStartChar, iNumChars, useClipboard])
Variable Description
sText The returned text. STRING.
iStartChar Optional: The position in the string (starting from 1) of the first character to return. INTEGER.
iNumChars Optional: The number of characters to return. INTEGER.
useClipboard Optional: Whether Silk Test Classic uses the new Clipboard method to return text. By default, this is set to FALSE and the original method, which is faster, is used. If you want to retrieve special characters, we recommend setting the parameter to TRUE to use the slower Clipboard method. BOOLEAN.


GetText returns the text from the single-line text field. It returns only the first line of a multi-line text field.
  • If you include iStartChar but not iNumChars, GetText returns the text from the iStartChar character to the end of the text.
  • If you include both arguments, GetText returns iNumChars characters, starting with the iStartChar character.


sAllText = GotoLine.Line.GetText()