Setup Factory 10

DlgListBox.FindItem

DlgListBox.FindItem

This is the first topic This is the last topic  

DlgListBox.FindItem

This is the first topic This is the last topic  

OverviewExamples

number DlgListBox.FindItem (

number ControlID,

number StartAfter,

string SearchText )

Example 1

Position = DlgListBox.FindItem(CTRL_LIST_BOX, -1, "Location*");

Searches the entire list box control for any item starting with "Location" and stores the first found location in the variable "Position."

Example 2

--Initialize all variables used

continue = true;

search_start = 1;

all_locations = {};

 

--Keep searching listbox until told not to

while continue do

   -- search listbox starting at position search_start

   location = DlgListBox.FindItem(CTRL_LIST_BOX, search_start, "*winner*");

   -- if search fails or nothing is found, do not continue

   if location == -1 then

       continue = false;

   else

       -- set next search start position, insert found value in table

search_start = location + 1;

       Table.Insert(all_locations, Table.Count(all_locations) + 1, location);

   end

end

This example searches the entire list box control for any items which contain "winner" and stores all of their locations in the table "all_locations."

See also: Related Actions


Learn More: Indigo Rose Software - Setup Factory - Buy Now - Contact Us