Hi,
I have a listbox (lstCadItens) in a form made of 3 columns (lstCadItens.ColumnCount=3), populated from a cursor that has 3 fields, created as a result of a SQL Select (lstCadItens.RowSourceType=2).
When the "Details" command button of that form is pressed I get the key to access a table to read the item's details by issuing:
wIT_CodItem = ThisForm.lstCadItens.List (ThisForm.lstCadItens.ListIndex, 2)
Select Table
Seek wIT_CodItem
In my test lstCadItens.ListCount=71131, and the ListBox shows fine, scrolls fine etc. All works fine, with the exception of ThisForm.lstCadItens.ListIndex being greater than
65000 (that by coincidence is the maximum number of
elements allowed for an array), when I get error number 31:
invalid subscript reference.
If I think of my ListBox as being an array, it would be an array of 213,393 elements (71,131*3), and it would not fit in the limit of 65,000 elements for arrays, but it exists and displays its content. OTOH, the error occurs when the first index (that points to the rows) to the "ListBox array" is 65,001 or greater.
The question is: should a ListBox be thought as an array, or this is a bug, because I have no knowledge of the limit of rows for a ListBox being 65,000 or any other value.
I'm working with VFP 6.0 SP5.
Thanks,
Fernando
PS. I already made a workaround and am working ok with my 71,131 rows ListBox, but still want to know more about this behavior, that I found a bit strange.