Polygrid data corruption?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Polygrid data corruption?
Has anyone else seen data corruption when using the Polygrid when deleting/adding rows and/or modifying the columns? I had some weird issue with multiple new empty columns being added. After deleting these new columns I now can't seem to access the data or text of the polyGrid and just get errors such as:
864,7,14,No matching handler for arguments with types (<type: livecode.lang.array>,<type: __builtin__.cbool>) - possible handlers (MCArithmeticEvalNumberFormattedAsString,MCLogicEvalBoolFormattedAsString)
865,7,14,E:/Projects/GitHub/LiveCode-LTD/summer-mega-bundle/src/PolyGrid/com.livecode.widget.polygrid.lcb
866,7,14,3200
897,7,14,1
456,7,14
465,7,14
253,7,14
Any help appreciated. Thanks!
864,7,14,No matching handler for arguments with types (<type: livecode.lang.array>,<type: __builtin__.cbool>) - possible handlers (MCArithmeticEvalNumberFormattedAsString,MCLogicEvalBoolFormattedAsString)
865,7,14,E:/Projects/GitHub/LiveCode-LTD/summer-mega-bundle/src/PolyGrid/com.livecode.widget.polygrid.lcb
866,7,14,3200
897,7,14,1
456,7,14
465,7,14
253,7,14
Any help appreciated. Thanks!
Re: Polygrid data corruption?
The commonest error with polygrid I've encountered is that data is
a) not numerically indexed
b) indexes do not start from 1 and are not sequential
Look at the data within the inspector to ensure this is an numerically indexed array starting from [1] and using sequential numbers.
It does mean if manipulating the array directly you need to re-sequence the array every time (I use a simpler handler at stack level for this).
This is a major disadvantage compared with the DataGrid, which has no such hiccups...
Stam
a) not numerically indexed
b) indexes do not start from 1 and are not sequential
Look at the data within the inspector to ensure this is an numerically indexed array starting from [1] and using sequential numbers.
It does mean if manipulating the array directly you need to re-sequence the array every time (I use a simpler handler at stack level for this).
This is a major disadvantage compared with the DataGrid, which has no such hiccups...
Stam
Re: Polygrid data corruption?
Thanks but the problem with the data corruption is that I can't now actually access any of the data at all, even though it's visible in the PG. Weird. Luckily I had previously exported the data, so could reset the text to empty and import the saved data...
Might be time to revert to the DG...
Might be time to revert to the DG...
Re: Polygrid data corruption?
The polygrid is supposed to be one of the bright stars of the "new" LC. A simpler, good looking (all as opposed to a table field), but still very handy DG substitute. I was just getting ready to start using them. It is a problem if it is not stable.
Craig
Craig
Re: Polygrid data corruption?
One of the annoying things with new controls is the plethora of options in a non-LC-code style.
eg. we should be able to:
sort control "pgControl" by column 2 numeric descending
or something similar. Different control script interfaces leads to hard-to-use, unintuitive scripting. These are the types of integration tasks that are key, IMO, to making the power of new controls accessible for all, rather than the few who explore them enough to discover their power. Never mind the bugs (though I'm sorta dismayed to see LCB errors appear).
Just my 2c. Cheers!
eg. we should be able to:
sort control "pgControl" by column 2 numeric descending
or something similar. Different control script interfaces leads to hard-to-use, unintuitive scripting. These are the types of integration tasks that are key, IMO, to making the power of new controls accessible for all, rather than the few who explore them enough to discover their power. Never mind the bugs (though I'm sorta dismayed to see LCB errors appear).
Just my 2c. Cheers!
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Polygrid data corruption?
There was an initiative a while back to address that with new syntax handling they called "open language". Not sure what happened with that.strongbow wrote: ↑Fri Feb 14, 2025 4:24 amOne of the annoying things with new controls is the plethora of options in a non-LC-code style.
eg. we should be able to:
sort control "pgControl" by column 2 numeric descending
or something similar. Different control script interfaces leads to hard-to-use, unintuitive scripting.
viewtopic.php?t=24500
https://use-livecode.runrev.narkive.com ... n-language#
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Polygrid data corruption?
Yeah, nice one. "a while ago" = 10 years.... How time flies.
Re: Polygrid data corruption?
Did someone already bug report the issues in the first posting? 

Re: Polygrid data corruption?
I have used the PolyGrid in multiple projects now and I’ve found it to be very useful and reliable. The only time I’ve seen any type of corruption was if I tried to import unsuitable data. I have only deleted columns on a few occasions and I did’t see any problems at the time, but that was from a relatively small amount of data though.
When you say you can’t access the data, how are you trying to access the data?
Can you still see the data in the Contents section of the Object Inspector? You should be able to inspect the text and the pgData of the PolyGrid.
Have you tried to export the csvData of the PolyGrid and inspect it for bad data?
Paul
When you say you can’t access the data, how are you trying to access the data?
Can you still see the data in the Contents section of the Object Inspector? You should be able to inspect the text and the pgData of the PolyGrid.
Have you tried to export the csvData of the PolyGrid and inspect it for bad data?
Paul
Re: Polygrid data corruption?
Couldn't see the data in the inspector.
Couldn't access either pgText nor pgData - errored out.
Haven't reported the error as haven't spent the time to reproduce in a shareable stack, unfortunately.
Couldn't access either pgText nor pgData - errored out.
Haven't reported the error as haven't spent the time to reproduce in a shareable stack, unfortunately.