Difference between revisions of "$editbox"
From Scriptwiki
(added info about selstart and selend and example) |
m |
||
(One intermediate revision by one other user not shown) | |||
Line 12: | Line 12: | ||
The above would see what text you have selected in the active editbox, tell you the amount of bytes selected and the text. | The above would see what text you have selected in the active editbox, tell you the amount of bytes selected and the text. | ||
− | == Also | + | == 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. | * [[On tabcomp]] The ''selstart'' and ''selend'' properties are very handy to use with the tab completion event. | ||
+ | |||
[[Category:Other Identifiers]] | [[Category:Other Identifiers]] |
Latest revision as of 10:20, 2 July 2007
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.