The following example retrieves the current selection in the Description text field. If no text is selected, an error is displayed.
local string selected_text; local integer start_position, selection_length; selected_text = Field_GetSelection(Description, start_position, selection_length); if selection_length = 0 then error "No text was selected."; end if;