Prev: SxS DLL location
Next: ActiveReports 2.0 Viewer Issue.
From: Lorin on 4 Dec 2007 19:01 VB6SP6 Is there a faster way to see if a subitem entry exists in a ListView than ListView.FindItem(something, lvwSubItem) ? Or is that something I can use in parallel with a ListView that I can enter an item in both controls and see if it exists in this other control as a test? Also, if I specify a control as sorted, do it make it faster to fiund things in it (maybe a binary search is used)? i.e. is there a control that we can search faster? This is what is slowing me down. I am trying to add unique entries to a ListView.
From: Lorin on 4 Dec 2007 20:08 I am now trying a collection in parallel with the listview for the subitem of interest. It is fast, but eats up lots of memory. I see my memory go from 100M down to 20M as it runs (that is out of 1G total). Hoping to find an API call into the ListView that works just as fast and takes no memory. "Lorin" wrote: > VB6SP6 > Is there a faster way to see if a subitem entry exists in a ListView than > ListView.FindItem(something, lvwSubItem) ? > Or is that something I can use in parallel with a ListView that I can enter > an item in both controls and see if it exists in this other control as a test? > Also, if I specify a control as sorted, do it make it faster to fiund things > in it (maybe a binary search is used)? > i.e. is there a control that we can search faster? > This is what is slowing me down. > I am trying to add unique entries to a ListView. > >
From: Ken Halter on 5 Dec 2007 10:06 "Lorin" <Lorin(a)discussions.microsoft.com> wrote in message news:37C1D0F2-565C-41FD-BD6E-D07E57E45AD8(a)microsoft.com... >I am now trying a collection in parallel with the listview for the subitem >of > interest. > It is fast, but eats up lots of memory. > I see my memory go from 100M down to 20M as it runs (that is out of 1G > total). > Hoping to find an API call into the ListView that works just as fast and > takes no memory. ListItems are already a collection. You can set a unique key for each one, just like a collection. -- Ken Halter - MS-MVP-VB - Please keep all discussions in the groups.. In Loving Memory - http://www.vbsight.com/Remembrance.htm
From: Dave O. on 5 Dec 2007 11:02 This may or may not be faster, but it will use less memory. Select a delimiter that will never appear in the subitem then declare a string and add each subitem to the string separated by the delimiter, then just use Instr to see if you already have the subitem listed. eg List of names, colon as delimiter TestList = ":ALICE:BOB:CAROL:DAVE:ERROL:FRED:GEORGE:" NewItem = "SUSAN" If Instr(TestList,":" & NewItem & ":") = 0 If the above is true then the name is not already listed. Note you may need to force everything to be the same case. Dave O. "Lorin" <Lorin(a)discussions.microsoft.com> wrote in message news:37C1D0F2-565C-41FD-BD6E-D07E57E45AD8(a)microsoft.com... >I am now trying a collection in parallel with the listview for the subitem >of > interest. > It is fast, but eats up lots of memory. > I see my memory go from 100M down to 20M as it runs (that is out of 1G > total). > Hoping to find an API call into the ListView that works just as fast and > takes no memory. > > > "Lorin" wrote: > >> VB6SP6 >> Is there a faster way to see if a subitem entry exists in a ListView than >> ListView.FindItem(something, lvwSubItem) ? >> Or is that something I can use in parallel with a ListView that I can >> enter >> an item in both controls and see if it exists in this other control as a >> test? >> Also, if I specify a control as sorted, do it make it faster to fiund >> things >> in it (maybe a binary search is used)? >> i.e. is there a control that we can search faster? >> This is what is slowing me down. >> I am trying to add unique entries to a ListView. >> >>
From: Bob Butler on 5 Dec 2007 11:16
"Dave O." <nobody(a)nowhere.com> wrote in message news:eZBptg1NIHA.820(a)TK2MSFTNGP06.phx.gbl... > This may or may not be faster, but it will use less memory. Select a > delimiter that will never appear in the subitem then declare a string and > add each subitem to the string separated by the delimiter, then just use > Instr to see if you already have the subitem listed. > eg List of names, colon as delimiter > TestList = ":ALICE:BOB:CAROL:DAVE:ERROL:FRED:GEORGE:" > NewItem = "SUSAN" > > If Instr(TestList,":" & NewItem & ":") = 0 > > If the above is true then the name is not already listed. > Note you may need to force everything to be the same case. If Instr(1,TestList,":" & NewItem & ":",vbTextCompare) =0 Then |