ZArrayList bad index
Moderator: Moderators
ZArrayList bad index
I wasn't getting these for some time, but now they're back? I got them on a few separate occasions under the same circumstances as the previous time (when attempting to move a component down in the Project Tree). Unfortunately I can't see any logic to it or how to reproduce it.
- Attachments
-
- 剪贴板图片 (20).png (44.7 KiB) Viewed 18774 times
Re: ZArrayList bad index
Does your project use Arrays? The first thing you should do is check your code that accesses arrays and make sure they stay within array bounds.
Re: ZArrayList bad index
Yes I use arrays but to me this doesn't look like it's connected - for example this time the error appeared when I attempted top move a RenderSetColor component in the OnRender (the component was unnamed and unconnected to any arrays from the project) to the bottom by clicking on one of the arrows in the IDE's toolbar. The previous time it was the same, I attempted to move a completely plain component to the bottom and it didn't want to move it.
Re: ZArrayList bad index
So it is not while the project is running? I haven't encountered this but let me know if you can reproduce a simple case and I'll make sure to fix it.
Re: ZArrayList bad index
Yes, it's not while the project is running - at least that's not what happened in this case. I haven't managed to reproduce it in simple projects, I only encountered it in my main project (which is pretty big). If I manage to reproduce it as a simple case I'll post it here
Re: ZArrayList bad index
From time to time (very rarely) I get some similar strange behavior but without actual reports of "ZArray" errors when I drag and copy a component in Project Tree while the project is running in Preview, meaning not adding a new component but LMB click on an existing component in Project Tree, press CTRL, drag the component elsewhere and release the LMB (the new copy of the component gets added to the bottom of wherever the destiantion was).
After moving the new component up it can happen that it just doesn't do anything – I usually do this only with simple components like SetRenderColor whose effects are easy to see. Can't really say for sure but it seems to me that the chances of the new component being strange are higher when I operate like this on components that are in OnRender.
This can be solved by saving and reopening the zgeproj file. In such cases I sometimes noticed the copy of the component was still on the bottom of wherever it was placed even though I think I moved it up. Again, can't say for sure.
Unfortunately I don't know how to reliably reproduce it yet
After moving the new component up it can happen that it just doesn't do anything – I usually do this only with simple components like SetRenderColor whose effects are easy to see. Can't really say for sure but it seems to me that the chances of the new component being strange are higher when I operate like this on components that are in OnRender.
This can be solved by saving and reopening the zgeproj file. In such cases I sometimes noticed the copy of the component was still on the bottom of wherever it was placed even though I think I moved it up. Again, can't say for sure.
Unfortunately I don't know how to reliably reproduce it yet