ITEM_INDEX$()

ITEM_INDEX$(N)

RETURNS THE 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: if no line (item) is selected, ITEM_INDEX$(N) returns "" (the empty string).

Remark 2: the keyword ITEM_INDEX$ ends by '$' because the returned value is a string.

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.
  • Result$ is a string.

USE

  • The function ITEM_INDEX$() is used to know the line 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 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()