VB6 app gives run-time error 6 overflow
My VB6 app gives run-time error '6' overflow. It is simply passing results of several file searches to a listbox. It only crashes when hundreds of lines have been written to the listbox, performing fine if there are are not that many. Is there a limit to how many lines a listbox can handle?
How can I trap this error and see what is causing it?
Re: VB6 app gives run-time error 6 overflow
you may have a variable set as a byte, then that variable if linked to the lines in the listbox would be overflowed at 255.
Check it out and change it to a long or integer or something, and no listboxes can go VERY FAR.
Re: VB6 app gives run-time error 6 overflow
There is a limit of 32,767 items. Exceeding that limit will generate the error you mentioned.
Re: VB6 app gives run-time error 6 overflow
Will check out the variables.
What constitutes an 'item' in a listbox?
Re: VB6 app gives run-time error 6 overflow
Quote:
Originally Posted by imperialdata
What constitutes an 'item' in a listbox?
Umm, an entry that was added using the AddItem method.
Re: VB6 app gives run-time error 6 overflow
Daft question I suppose but was surprised to learn you could have 32,767 single characters or 32,767 large strings
Re: VB6 app gives run-time error 6 overflow
Quote:
Originally Posted by imperialdata
My VB6 app gives run-time error '6' overflow. It is simply passing results of several file searches to a listbox. It only crashes when hundreds of lines have been written to the listbox, performing fine if there are are not that many. Is there a limit to how many lines a listbox can handle?
How can I trap this error and see what is causing it?
Use the listview control instead :wave:
Re: VB6 app gives run-time error 6 overflow
Can you explain why it's better Remix?
Re: VB6 app gives run-time error 6 overflow
Quote:
Originally Posted by imperialdata
Can you explain why it's better Remix?
It's a more robust control in that you can have more than 32,767 items and, if you need them you can have functional multiple columns and column headers, etc.