ITEM_INDEX()

ITEM_INDEX(N)

RETURNS THE INDEX OF SELECTED ITEM OF THE SYSTEM OBJECT NUMBER N

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

ACTION

The function ITEM_INDEX(N) returns the line (item) of the system object designated by its number N, which has been selected by the user.

The system object is of type : COMBO, LIST.

Remark 1: the first item has the index 1.

Remark 2: if no line (item) is selected, ITEM_INDEX(N) returns 0.

SYNTAX: Result=ITEM_INDEX(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 ITEM_INDEX() is used to know the index of the line of a COMBO or a LIST, selected by the user.

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 the system object number N does not exist.
  • If number N is not the number of a COMBO, a LIST.

EXAMPLE

rem create a LIST

list 1

rem fill the LIST with 2 lines

item_add 1,"This is line 1"

item_add 1,"This is line 2"

rem print the idex of the selected item of LIST

print item_index(1)

SEE ALSO

COMBO

LIST

FILE_ADD

ITEM_ADD

ITEM_INSERT

ITEM_DELETE

ITEM_SELECT

COUNT()

ITEM_READ$()

ITEM_INDEX$()