PROPLIST.GetItem

Previous  Next

 

item = PROPLIST.GetItem( propname AS STRING,

                         item     AS INTEGER ) AS VARIANT

 

item = PROPLIST.GetItem( propindex AS INTEGER,

                         item      AS INTEGER ) AS VARIANT

 

 


 

Returns requested information about a property.  The property can be specified by the name or zero offset index.  The return data type depends on the property.  You can request the number of properties by specifying property index 0 and item 0 or calling GETITEM without any parameters.

 

The function uses the default panel selected by using PROPLIST.SelectPane.

 

' Item Types for GetItem calls

 

CONST PL_Item_NoOfItems    = 0

CONST PL_Item_Name         = 1

CONST PL_Item_Descr        = 2

CONST PL_Item_Type         = 3

CONST PL_Item_Enabled      = 4

CONST PL_Item_ButtonType   = 5

CONST PL_Item_Option       = 6

CONST PL_Item_Min          = 7

CONST PL_Item_Max          = 8

CONST PL_Item_AutoEnable   = 9

CONST PL_Item_Index        = 10

CONST PL_Item_ID           = 11

CONST PL_Item_Trigger      = 12

 

Example:

 

DIM ID AS INTEGER

DIM index AS INTEGER

DIM controlname AS STRING

 

index = 0

ID = 0

 

PRINT "No of Items: ";PROPLIST.GETITEM( 0, PL_Item_NoOfItems ),

' Also Valid...

PRINT "No of Items: ";PROPLIST.GETITEM(),

 

DO

  ID = PROPLIST.GETITEM( index, PL_Item_ID )

  IF ID >= 0 THEN

     controlname = PROPLIST.GETITEM( index, PL_Item_Name )

     PRINT "Index: ";index;",  ID: ";ID;",  Name: ";controlname,

  ENDIF

  index = index + 1

UNTIL ID < 0

 

' Another simpler way of doing this

DIM i AS INTEGER

 

FOR i = 0 TO PROPLIST.GETITEM() - 1

  PRINT FORMAT( "Index: %03d,  ID: %03d,  Name: %s\n", i,_

                                                       PROPLIST.GETITEM( i, PL_Item_ID ),_

                                                       PROPLIST.GETITEM( i, PL_Item_Name ) )

ENDFOR