Difference between revisions of "$editbox"

From Scriptwiki
Jump to: navigation, search
 
(added info about selstart and selend and example)
Line 1: Line 1:
 
Returns the text in the editbox of the specified window.
 
Returns the text in the editbox of the specified window.
  $editbox(window,N)
+
  $editbox(window,N)[.selstart][.selend]
 
If N = 1, returns the text in the second editbox in a channel window, if it's open.
 
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 ==
 
== Example ==
 
  $editbox(Status Window)
 
  $editbox(Status Window)
 
This returns the current text in the editbox of the [[Status Window|status window]].
 
This returns the current text in the editbox of the [[Status Window|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.
  
 +
== Also See ==
 +
* [[On tabcomp]] The ''selstart'' and ''selend'' properties are very handy to use with the tab completion event.
 
[[Category:Other Identifiers]]
 
[[Category:Other Identifiers]]

Revision as of 18:14, 30 July 2006

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.

Also See

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