$editbox

From Scriptwiki
Jump to: navigation, search

Returns the text in the editbox of the specified window.

$editbox(window,N)[.selstart][.selend]

If N = 1, returns the text in the second editbox in a channel window, if it's open. If you give the selstart or selend property it returns where the start or end of highlight in the editbox is. If you do not have a selection selstart and selend return the same value.

Example

$editbox(Status Window)

This returns the current text in the editbox of the status window.

var %i = $editbox($active).selend - $editbox($active).selstart
echo -ag You have selected %i bytes. Text: $mid($editbox($active),$editbox($active).selstart,%i)

The above would see what text you have selected in the active editbox, tell you the amount of bytes selected and the text.

Note

The selstart is always lower than selend no matter if the cursor is dragged forwards or backwards to highlight the text.

See Also

  • On tabcomp The selstart and selend properties are very handy to use with the tab completion event.