For a Text Input object named myTextInput, use the following syntax:
myTextInput.SetSelection(-1)
// sets the insertion point at the end of the text in myTextInput
myTextInput.SetSelection(0,-1)
// Selects the whole of the text in myTextInput
myTextInput.SetSelection(5,5)
// Sets the insertion point at the fifth character in myTextInput
This function is normally used with the ReplaceSelection function. For example, if myTextInput contains "Mr Smith", the following syntax will insert the first name ‘James’ in myTextInput
myTextInput.SetSelection(3,3)
myTextInput.ReplaceSelection("James ")
In this example, myTextInput now contains "Mr James Smith".