Listbox.items[index] := 'SomeStrContent'; crashes the app
The assignment of
Listbox.items[index] := 'Stringcontent';
crashes the app.
ErrorMessage is "ListItems out of bounds".
In this concret Szenario the Listbox has one entry and index is Zero.
Comments (15)
-
-
Error is on MAC
-
repo owner Again, what version of CrossVcl ? Try to uninstall/install latest one. 0.99a works good in your case
-
Yes, it was 0.99a.
But strange, with a new form it works, but not with an existing.
With Debugging I can step to unit Vcl.stdctrls, in
procedure TListBoxstrings.delete (Index:Integer) ListBox.Deletestring(index), // Here it crashes end;
it crashes then.
-
Here the error message from paserver
-
repo owner We added code which is print CrossVcl runtime version in PAServer at 0.99b. It looks like your application still use old version. Please check new version and confirm if you notice correct CrossVcl version.
-
I've installed Version .99b (Version-Code is shown in PAServer), but same issue, but only especially with this one app.
I've found out more details, perhaps it will help you. The error only occurs, when the LAST ITEM in the listbox is affected. Setting the last item (eg listbox.items[0] := 'Test' with one items) or deleting the last item has always a deleting call (ListBox.Deletestring(index), and that crash the app.
But as I mentioned, when I use it in an other app, all works as expected. Strange Thing! If you have no idea, so leave it alone, perhaps I'm the only person with that problem and I can make a programmatical workaraound to work not on the last item.
An other bug (also in new created Project) I found: ListBox1.items.clear; has no effect (mac and Linux)
-
repo owner - changed status to resolved
Should be fixed at 0.99c
-
Unfortunatelly not. On a new Project it works, but not on an old one. Attached you find the Project-file, perhaps you can see something irregular issues.
-
- attached PCDBServ.zip
-
repo owner I didn't found any issue with project file. I've added ListBox unit from test project and it works the same. Can you post here TListBox property values from DFM ?
-
repo owner - changed status to open
-
I have made an excerpt of the app (two forms, the main form and the user rights form, no additional units are needed) and send you the files (the reduced Project) als zipfile to support@crossvcl.com. In the mail you'll find instructions to reproduce the error.
On Linux it crashes also when you try to add an item to the listbox. But strange, as I said, this problems are not in a new created project. I hope it helps.
-
repo owner - changed status to resolved
Fixed at 0.99d
-
Congratulation, now it works perfect, also on Linux!
- Log in to comment
Correct errormessage was "List index (-1) out of bounds"