guiMemoSetCaretIndex | Multi Theft Auto: Wiki Skip to content

guiMemoSetCaretIndex

Client-side
Server-side
Shared

Pair: guiMemoGetCaretIndex

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function sets the current position of the caret (the text cursor) within the memo.

OOP Syntax Help! I don't understand this!

  • Method: guimemo:setCaretIndex(...)
  • Variable: .caretIndex

Syntax

bool guiMemoSetCaretIndex ( gui-memo theMemo, int index )
Required Arguments
  • theMemo: The memo edit box where the caret position is to be changed.
  • index: An integer referring to the desired character position within the box. 0 would be before the first character in the box, 1 before the second, etc.

Returns

  • bool: value

Returns true if the caret was successfully moved, false otherwise.

Code Examples

shared

This example would create a memo and set the caret before the "H" in "Hi".

local memo = guiCreateMemo(100,100,200,100,"Hi",false)
guiMemoSetCaretIndex(memo,0)--sets the caret before H

See Also

GUI Functions