How to type cast INTEGER to STRING data type for use in SetText() method
The following article will demonstrate how to use type casting to convert an INTEGER data type to a STRING for use with the SetText() method.
The SetText() method only accepts a STRING data type to be used for the text value in its parameters. If you need to use an INTEGER type, you can use type casting to convert to a STRING and then pass this into the SetText.
The below code shows how this can be done by converting an integer to a string in the Integer2String function and then calling this in the Convert() testcase.
[-] String Integer2String (integer y)
[ ] STRING text
[ ] text = ([STRING]y)
[ ] print (text)
[ ] TextField.SetText(text)
[ ] return text
[-] testcase Convert() appstate none
[ ] Integer2String(12345)
For further reading on type casting and the available operators, please see the Silk Test help topic 'Type Cast Operator'.