SetItemSelection()

Summary

Sets the highlighted text in an edit text dialog box item.

Syntax

SetItemSelection(string item_name, integer start, integer end)

Argument Contents
item_name The name of the edit text item whose selection is set
start The index of the character before the first character selected
end The index of the last character selected

Notes

  • The item_name must be an edit text dialog box item in the current dialog box.

  • If the start and end values are equal, then no text is selected and the value indicates the location of the cursor.

Example

// Highlight the date in the edit control
edit_string = "The date is " + date_string + " today."
SetItemSelection("edit control", 12, 12 + Len(date_string))

Error Codes

Error Type Meaning
NotFound The specified item does not exist, is not in the current dialog box, or is not an edit text item

See Also

Function Summary
GetItemSelection() Gets the highlighted portion (selection) of an Edit Text dialog box item
SetItem() Moves the keyboard focus to a dialog box item