After selecting column visibility in DG table, code stops

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
CAsba
Posts: 368
Joined: Fri Sep 30, 2022 12:11 pm

After selecting column visibility in DG table, code stops

Post by CAsba » Tue Dec 12, 2023 1:55 pm

Hi all,
I have a table dg "datagrid 3", with 33 columns and a few rows. The user selects a task and the code makes appropriate columns visible.

Code: Select all

set the dgProps["column visibility"] of group "datagrid 3" to  true,true,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false
   answer "xxx"
The code "answer "xxx"" represents the remainer of the code. 'xxx' does not show at runtime.
If I comment out the set the dgProps... ,false, the "xxx" shows (and the remainer of the code works).
Could there be some 'unfinished business' I have missed that makes the dg prevent further coding from being activated ?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9678
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: After selecting column visibility in DG table, code stops

Post by dunbarx » Tue Dec 12, 2023 3:23 pm

I guess you mean that
'xxx' does not show at runtime.
the rest of the handler runs normally?

There is nothing wrong that I can see with your code. In fact, I found that the dictionary has an error regarding the ability to individually set the visibility of certain columns as you did. It is a list of boolean items, not lines. The published API is correct, though.

Anyway, a handler addressing a test DG I made, albeit rather smaller, works fine. Code following the setProp line executes without issue.

Rewrite that line from scratch. Any problem with the text of even one of those parameters will cause that line to fail, and execution will stop.



Craig
Last edited by dunbarx on Tue Dec 12, 2023 3:35 pm, edited 1 time in total.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9678
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: After selecting column visibility in DG table, code stops

Post by dunbarx » Tue Dec 12, 2023 3:26 pm

Nope.

I copied your actual line of code into my test stack and everything works fine.

Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9678
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: After selecting column visibility in DG table, code stops

Post by dunbarx » Tue Dec 12, 2023 5:26 pm

And are you sure you have the name of the DG right?

Craig

CAsba
Posts: 368
Joined: Fri Sep 30, 2022 12:11 pm

Re: After selecting column visibility in DG table, code stops

Post by CAsba » Tue Dec 12, 2023 6:27 pm

To be clear, I should have said

The code "answer "xxx"" represents the remainer of the code. 'xxx' does not show at runtime, AND NEITHER DOES THE REMAINER OF THE CODE.

Yes, the dg name is right, and the columns-visible configuration is made and is correct.

It's just that no code after the column visibility coding is working, not even something as simple as 'answer "xxx"'.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9678
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: After selecting column visibility in DG table, code stops

Post by dunbarx » Tue Dec 12, 2023 6:44 pm

Hi.

Make and name another DG. Put some data into it, perhaps from the inspector. It does not need to have as many columns as the original.

Try the same code for this new DG. Does it pass?

Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9678
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: After selecting column visibility in DG table, code stops

Post by dunbarx » Tue Dec 12, 2023 6:47 pm

CAsba.

I doubt that this is important, but
The code "answer "xxx"" represents the remainer of the code. 'xxx' does not show at runtime, AND NEITHER DOES THE REMAINER OF THE CODE.
Are we clear that all you ever meant was that execution stopped at the "set the DGProps..." line?

Craig

CAsba
Posts: 368
Joined: Fri Sep 30, 2022 12:11 pm

Re: After selecting column visibility in DG table, code stops

Post by CAsba » Wed Dec 13, 2023 2:21 pm

Hi Craig,
Yes.
I did a re-install of LC and now everything os fine.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9678
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: After selecting column visibility in DG table, code stops

Post by dunbarx » Wed Dec 13, 2023 7:12 pm

CAsba.

Really? And that was the only thing in the stack you noticed that was amiss?

Anyway, glad it is resolved. I have only had to reload LC once in my life to fix some sort of recalcitrant problem. I have had to delete the preferences file a couple of dozen times, still not too bad. I wonder if that would have solved your problem as well.

Craig

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”