You didn't provide the compile-able source code. I can copy/paste your code to my Lazarus IDE, but it can't be compiled because you haven't provide all the required files.If you don't know how to provide the compile-able source code, here is how to do it:Create a new folder, copy and paste all the necessary files except: the binary (exe file), *.bak, lib and backup folders. Compress the folder and send the zip to the forum.Please provide the source code that has issue, I'm more interested to know what caused the error.
Try the attached project.I've commented the two changes I made.I also renamed one unit to be all lowercase so the project will compile on platforms other than Windows.
Quote from: Zvoni on April 14, 2021, 04:19:46 pmthat "pb.Tag" you use as an array-index irritates meaccording to https://lazarus-ccr.sourceforge.io/docs/rtl/classes/tcomponent.tag.html https://lazarus-ccr.sourceforge.io/docs/lcl/extctrls/tpaintbox-2.html Tag (inherited from TComponent) is of Type PtrInt, and in your code i don't see anywhere you assigning a value to Tag, so it wouldn't surprise me, if Tag is NilNevermind, that if Tag is really a (valid) pointer, i'm pretty sure it's not going to be in the range of 1..2 you need as an array-indexCan you check the Value of Tag just before you call your troublesome function?Do I check the Value with a ShowMessage-command or how do I check it?
that "pb.Tag" you use as an array-index irritates meaccording to https://lazarus-ccr.sourceforge.io/docs/rtl/classes/tcomponent.tag.html https://lazarus-ccr.sourceforge.io/docs/lcl/extctrls/tpaintbox-2.html Tag (inherited from TComponent) is of Type PtrInt, and in your code i don't see anywhere you assigning a value to Tag, so it wouldn't surprise me, if Tag is NilNevermind, that if Tag is really a (valid) pointer, i'm pretty sure it's not going to be in the range of 1..2 you need as an array-indexCan you check the Value of Tag just before you call your troublesome function?