Hi,
Could anyone sort this code out for me, please? I really don't understand it (Sapero again!)
http://www.ionicwind.com/forums/index.php?topic=789.msg6989#msg6989
I need it to work in IWB. I have a listview in a dialog window called dView, and the listview
has the ID of 1
Would be great if I could get it working. Can't post the whole of the code, as the data
is covered by the Data Protection Act here
Many thanks,
Brian
From the help file:
Quoteposition = CONTROLCMD( window | dialog, ID, @LVFINDITEM, text$)
Searches for an item. Returns the zero-based index of the item or -1 if the item could not be found.
text$ is the case sensitive string to search for.
so:
string text$="findme"
int index = CONTROLCMD(dView, 1, @LVFINDITEM, text$)
if index <>-1
CONTROLCMD(dView, 1, @LVSETSELECTED, index)
endifLarryMc
Larry,
Thanks for your input. I'm working on it at the moment, but it doesn't appear to be
doing much - just hangs the listview up
Time to have a cup of tea!
Brian
Larry,
Am I missing something here? Do I have to loop through the listview items for
LVFINDITEM to work? Surely it can't just iterate through the items on its own?
Brian
Yes, I does go through the items in the listview looking for the exact match.
I looks for the ITEMS and not the rest of the columns that may be present.
LarryMc
Larry,
Sorry if I'm being a bit thick tonight - but what exactly do you mean by ITEM ?
If you can't look for a string in any of the rows, what's the point?
Brian
it searches all the ROWS but only in the first COLUMN.
If you want to search the other COLUMNs then you'll have to search through the ROWS yourself.
LarryMc
Right - gotcha. Works now...
Brian