Deleting dataGrid columns via code

Phil Davis revdev at pdslabs.net
Tue Jul 22 16:25:27 EDT 2014


Hey, didn't we do this same dance a couple of weeks ago?

put the dgText of the DG into tText
split tText by column
delete variable tText[z]
delete variable tText[y]
delete variable tText[x]
combine tText by column
set the dgText of DG to tText

If this approach produces empty columns x,y,z then you could do this:

put the dgText of the DG into tText
split tText by column
delete variable tText[z]
delete variable tText[y]
delete variable tText[x]
put the keys of tText into tKeyList
sort items of tKeyList numeric
put x,y,z into tRejects
repeat for each item x in tKeyList
if x is among the items of tRejects then next repeat
     add 1 to newX
     put put tText[x] into tNewText[newX]
end repeat
combine tNewText by column
set the dgText of DG to tNewText


Best -
Phil Davis


On 7/22/14, 12:30 PM, Magicgate Software - Skip Kimpel wrote:
> Good afternoon,
>
> I have a datagrid that I am reading into tTempText.  Once it has been read
> in, I need to delete column X, column Y and column Z.
>
> X, Y and Z constantly change but I have those numbers before I start
> processing the request.
>
> Suggestions to do this properly?
>
> SKIP
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>

-- 
Phil Davis





More information about the use-livecode mailing list