Action
Returns the text of the text field.
Syntax
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.
|
Notes
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.
Example
STRING sAllText
sAllText = GotoLine.Line.GetText()