DADiSP Worksheet Functions > Function Categories > Cursor Functions > CURPOS

 

CURPOS

Purpose:

Returns the last position of the crosshair cursor in a Window.

Syntax:

CURPOS(win, item, cursor)

win

-

Optional. Window reference. Defaults to the current Window.

item

-

Optional. An integer specifying the item number (i.e. series) in the Window. Defaults to 1.

cursor

-

Optional. An integer, the cursor number.

1:

First cursor (default)

2:

Second (delta) cursor

Returns:

The point or index number in the specified series or item where the cursor was most recently placed. If the cursor was never activated in the given Window, the point number returned is 0.

Example:

extract(W1, curpos(W1), 10)

 

extracts 10 points from the series in Window 1, starting from wherever the cursor was last placed.

Example:

curpos(W1, 1, 2)

 

returns the index number of the second cursor location for the first series in Window 1.

Remarks:

CURPOS allows you to simply move the cursor to an interesting part of a series without referencing a specific point number.

 

Changes in cursor position do not propagate through the Worksheet. If you want to update a Window dependent on a new cursor position, use the Line Editor ([F3] key) to re-enter the line so that the cursor position is re-evaluated.

 

The x-axis value at the cursor location is: (CURPOS-1)*deltax + xoffset

 

A series or an XY plot are considered as a single item.

 

DADiSP "remembers" the last position of the cursors; when a cursor is placed on the series, it is drawn at the most recent location (which may mean that the window is redrawn to display that x or y range). To disable this feature, use setconf("CURSOR1_MEMORY","0") and setconf("CURSOR2_MEMORY","0").

 

See CURLOC to return the coordinates of the crosshair cursor.

 

See CURNPUT to set the index position of a cursor.

See Also:

COLNMOVE

COLPOS

CUREXTRACT

CURLOC

CURMOVE

CURNMOVE

CURPOSSET

CURPUT

CURSORON

dadisp.cnf (configuration file)

NUMITEMS