SetCommandSelection
Script function

world.SetCommandSelection

DOC_scripting Read about scripting

Type

Method

Summary

Selects specified columns in the command window

Prototype

long SetCommandSelection(long First, long Last);

DOC_data_types View list of data type meanings


Description

Lets you select text in the command window. This is intended for specialized applications like a spell checker where, after finding a spelling mistake, you select the misspelt word.

First - the first character to select (1-relative), so the first character is 1.

If "First" is zero, then any selection is removed.


Last - the last character to select (1-relative).

If "Last" is -1 then the rest of the line is selected.

Thus, to select everything, make First = 1 and Last = -1.

To put the cursor between characters, specify them backwards. See the example below.


Examples:

SetCommandSelection (2, 4) --> select characters 2 to 4
SetCommandSelection (0, 0) --> select nothing
SetCommandSelection (1, -1) --> select everything
SetCommandSelection (10, -1) --> select column 10 onwards
SetCommandSelection (6, 5) --> put the cursor between column 5 and column 6


If you want to *get* the current selection in the command window, use GetInfo(236) (first character) and GetInfo(237) (last character).



VBscript example

SetCommandSelection 2, 4



Jscript example

world.SetCommandSelection (2, 4);



PerlScript example

$world->SetCommandSelection (2, 4);



Python example

world.SetCommandSelection (2, 4)



Lua example

SetCommandSelection (2, 4)



Return value

eOK: Set OK


DOC_errors View list of return code meanings


See Also ...

Topics

DOC_send_paste Commented softcode
DOC_send Sending to the world

Functions

FNC_Note Note (Sends a note to the output window)
FNC_PasteCommand PasteCommand (Pastes text into the command window, replacing the current selection)
FNC_Send Send (Sends a message to the MUD)
FNC_SendImmediate SendImmediate (Sends a message to the MUD immediately, bypassing the speedwalk queue)
FNC_SendNoEcho SendNoEcho (Sends a message to the MUD without echoing in the output window)
FNC_SendPkt SendPkt (Sends a low-level packet of data to the MUD)
FNC_SendPush SendPush (Sends a message to the MUD and saves it in the command history buffer)
FNC_SendSpecial SendSpecial (Sends a message to the MUD with various options)
FNC_SetCommand SetCommand (Sends text to the command window)

(Help topic: function=SetCommandSelection)

DOC_contents Documentation contents page