COLPOS

Purpose:

Returns the item or column number of the last position of the crosshair cursor in a Window.

Syntax:

COLPOS(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 item or column number in the specified Window where the cursor was most recently placed. If the cursor was never activated in the given Window, the column number returned is 0.

Example:

region(W1,1,length(W1),colpos(W1,1,1),

numcols(W1)-colpos(W1,1,1))

 

extracts a rectangular region from the table in Window 1, starting from the item where the first cursor was last placed.

 

colpos(W1, 1, 2)

 

returns the item number of the second cursor location for the first item in W1.

Remarks:

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.

 

A series or an XY plot are considered an 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").

 

To disable DADiSP from remembering the column number of the last cursor location, use setconf("ITEM_MEMORY","0").

See Also:

COLNMOVE

CURMOVE

CURNMOVE

CURPOS

CURPUT

CURSORON

dadisp.cnf (configuration file)

NUMITEMS