GetItemSelection()
Summary
Gets the highlighted portion (selection) of an Edit Text dialog box item.
Syntax
selection = GetItemSelection(string item_name)
| Argument | Contents |
|---|---|
| item_name | The name of the edit text item from which to retrieve the selection |
Returns
An array of two elements indicating the start and end of the selected text.
| Element | Type | Contents |
|---|---|---|
| 1 | Integer | The index of the character after which the selection begins |
| 2 | Integer | The index of the character after which the selection ends |
Notes
-
Item_name must be an Edit Text dialog box item in the current dialog box.
-
If the two elements of the selection array are equal, then no text is selected and their value indicates the location of the cursor.
Example
sel = GetItemSelection("name item") // sel might contain, for example, {4, 12}
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 |
|---|---|
| SetItem() | Moves the keyboard focus to a dialog box item |
| SetItemSelection() | Sets the highlighted text in an Edit Text dialog box item |