Name: selection

Type: keyword

Syntax: the selection

Syntax: selection()

Summary: The <selection> is a reference to the currently <selected> text.

Introduced: 1.0

OS: mac,windows,linux,ios,android

Platforms: desktop,server,web,mobile

Example:
put empty into the selection -- deletes the selection

Description:
Use the <selection> <keyword> to get the currently <selected> text or to replace the <selection>.

Certain commands--in particular, the cut and <copy> <command|commands>--operate on the <selected> text.

>*Note:* The <selection> <keyword> is implemented internally as a <function(control_st)> and appears in the <functionNames>. However, unlike most <function(glossary)|functions>, the <selection> lets you put things into it, and behaves like a <container> rather than a <function(control_st)>.

References: selectGroupedControls (property), selected (property), openField (message), selectionChanged (message), intersect (keyword), selection (keyword), function (control_st), selectedLoc (function), mouseColor (function), functionNames (function), copy (command), keyword (glossary), command (glossary), function (glossary), container (glossary)

Tags: ui
