Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
'Bug' with AddListItem in VisFox5
Message
From
28/09/1998 07:57:35
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
28/09/1998 06:55:40
Steve Camsell
Windmill Associates
Bath, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00141353
Message ID:
00141365
Views:
29
>I just found out that there is a limit on the ItemId that you supply when you use the AddListItem method in a ListBox. The maximum acceptable value is 32767. There is no mention of this at all in the help file, it refers only to an integer, which I assumed would be -2,147,483,647 to 2,147,483,647. This is not the case. It also gives a very misleading error message, Function, arguement, value or type....
>
>It's not likely that you would have that many items in your listbox, but if like me, you were using the ItemId to tie a row in the list box to a record Id instead of adding an extra invisible column to store the record id, you get a nasty little bug that is only triggered when you have got more than 32767 records in your table.
>
>I think the least that MS could do is to mention this feature in the help file .
Yes,
Integer there is 16 bits not 32 bits and limit is 65535 signed (-32767...0..32767).
for ix = 32760 to 40000
 this.addlistitem(str(ix),iif(ix<=32767,ix,ix-32767),1)
endfor
Of course question is now what would happen you exceed that limit too. Probably I would keep actual recnos in cursor and use cursor recno()s as nItemId.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform