CARET_POSITION()

CARET_POSITION(N)

RETURNS THE CARET POSITION OF THE SYSTEM OBJECT NUMBER N

  • Type: Function
  • Parameter: 1
  • Group: System Objects

ACTION

The function CARET_POSITION(N) returns the caret position P of the system object number N.

The system object is of type : EDIT, MEMO, COMBO, SPIN, MEMO_RICH, SYNEDIT.

SYNTAX: Result=CARET_POSITION(N)

  • N = system object number (integer or real). Must be greater than 0 and less than or equal to the allowed maximum number of system objects.

USE

  • The function CARET_POSITION() is used to know the caret position in an object handling text.

ERROR

  • If number N is not a correct expression.
  • If number N exceeds the allowed maximum number of system objects.
  • If number N is less than 0.
  • If system object number N does not exist.
  • If the object number N is not of type : EDIT, MEMO, COMBO, SPIN, MEMO_RICH, SYNEDIT.

EXAMPLE

rem create an EDIT

edit 1

rem display a text

text 1,"Hello"

rem put the caret between "e" and "l"

set_focus 1

caret_position 1,2

print

print

print caret_position(1)

print 2

SEE ALSO

EDIT

MEMO

COMBO

SPIN

MEMO_RICH

SYNEDIT