Note that there are some explanatory texts on larger screens.

plurals
  1. POListbox owerflow problem when list-items are numbers
    primarykey
    data
    text
    <p>listbox always overflows which has more than thousands of items, i need a way to get rid of this.. I need to use an alternate object which can act as listbox!</p> <pre><code>Private Sub difference_Click() 'Find differences and show' j = 0 For i = 0 To secretlist1.ListCount - 1 'If i use 2nd "for" with J it would cause to get same items again and again! 'for that reason im not gonna do that instead im using a definition for j as long 'but it keeps overflow problem so icant use it either. If Val(secretlist2.List(i)) &lt;&gt; Val(secretlist1.List(j)) Then lostonelist.Visible = True 'show the lostonelist lostonelist.AddItem secretlist1.List(j) 'add the items which are not in list2 i = i - 1 'if they r not equal to each other move list2 index to previous one End If j = j + 1 'we moved list2 index to previous cause list1 index always will be increasing 'and when they r not equal to eachother we must make sure that next item in list1 'will be compared with the same item in list2 Next End Sub </code></pre> <p>OR an easier way to do it with Do While:</p> <pre><code>Private Sub difference_Click() 'Find differences and show' j = 0 i = 0 'For i = 0 To secretlist1.ListCount - 1 Do While Not secretlist1.ListCount - 1 If Val(secretlist2.List(i)) &lt;&gt; Val(secretlist1.List(j)) Then lostonelist.Visible = True lostonelist.AddItem secretlist1.List(j) i = i - 1 End If j = j + 1 i = i + 1 Loop End Sub </code></pre> <p>What i am trying is searching the items that is not in secretlist2 while they remains in secretlist1.. Also in these listboxes all my items are numbers no string in any of them.. But "secretlist1(j)" always overflows i need a way to get rid of this.. and i have thousans of list items. i need another object which i can use as listbox, im still searching for a solution i think this is a good example and when i found an answer to it before u can find.. ill post it here. Ty already. </p> <p>Important Note: This is a Visualbasic 6 project not a .NET project!</p> <p>i was making this example for teaching my little brother how to! but i overflow my self while doing it "facepalm" xD</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COWhat do you mean by "secretlist1(j) always overflows"? I'm not following you. In the code snippet you provide, I can't see any check `j` being within the list item count - maybe, this is your problem?
      singulars
    2. COwhat i mean is the list that im using named as secretlist1("index as j") is giving me same error again and again as "overflow" So i know that is because of (j) element which is integer and cant reach further than 32768 list items, cause integer has 32768 numeric range just because of that i need a better solution than making aerobic movements with listbox.. I got more than thousands of items in my listbox thats why i get this error! Way more than integer or double or long.. Checking (j) is not gonna help as long as i keep using integer, double or long...
      singulars
    3. CO| -1 | | 0 | ---> in a position like this, as list item. my first list item in first list will be -1 while my first item in second list will be 0 thats why i decount second list to previous item cause when "for" turns up second list index will increase again and will be at first item again to get equalivent of first list item and for every first list item that is not equals to second list item will be added to third list.. i can do it without using "for", i can use "do while ** loop" but its gonna overflow again so i need to keep checking equals within integer range..
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload