Home » Developer & Programmer » Forms » Getting the list index of the selected list element : Very Urgent
Getting the list index of the selected list element : Very Urgent [message #78263] Wed, 06 February 2002 00:59 Go to next message
Shiju Joy
Messages: 4
Registered: February 2002
Junior Member
Hi,

Iwould like to delete the selected element from the List Box(TList).
For deleing an element I need to know the element index of the selected element.

Can anybody help me in fetching the list index of the selected list element.

Regards
Shiju
Re: Getting the list index of the selected list element : Very Urgent [message #78264 is a reply to message #78263] Wed, 06 February 2002 06:12 Go to previous message
Srinivas Konda
Messages: 29
Registered: October 2001
Junior Member
There is no built-in to get the list index. You need to write your own logic. Here is one you can use.

USAGE:
v := get_list_index(:system.cursor_value, 'LIST1');

-- V is a variable, returned by the function GET_LIST_INDEX, Use the VARIABLE V to delete from your list or what ever.
DELETE_LIST_ELEMENT('LIST1', v );

Function :

FUNCTION get_list_index(compareval IN VARCHAR, list_name IN VARCHAR2) RETURN NUMBER IS
listcount NUMBER(10);
BEGIN
listcount := GET_LIST_ELEMENT_COUNT(list_name);
FOR i IN 1..listcount LOOP
IF UPPER(compareval) = UPPER(GET_LIST_ELEMENT_VALUE(list_name, i)) THEN
RETURN i;
END IF;
END LOOP;
RETURN -1;
END;
Previous Topic: re: ORA-03121
Next Topic: Re: sending a byte to parellel port from d2k under windows98
Goto Forum:
  


Current Time: Thu Mar 28 18:34:00 CDT 2024