Setting hilite property of a button in the main Stack from a subStack

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
trags3
Posts: 432
Joined: Wed Apr 09, 2014 1:58 am

Setting hilite property of a button in the main Stack from a subStack

Post by trags3 » Thu Mar 04, 2021 1:46 am

I Have a Main Stack that at the end of the app gets saved as a PDF file.
There is a sub stack that provides the user the ability to enter data into the Main stack.
I need to coordinate a few check boxes between the 2 stacks.
In the sub stack when a checkbox is selected or deselected I want a corresponding checkbox on a card in the main stack to mirror it.

Code: Select all

repeat with n=1 to 6
      --the fields are named odocs1 thru odocs6 on both cards
      put odocs & n into tbtn
      if the hilite of tbtn  then
          set the hilite of tbtn of cd "4" of stack"MainStack" to true
      end if
  end repeat
I have tried dozens of variations to no avail. Maybe it can't be done?

Tom

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Setting hilite property of a button in the main Stack from a subStack

Post by dunbarx » Thu Mar 04, 2021 2:35 am

Hi.

A quick glance at your handler shows issues. For example:

Code: Select all

if the hilite of tbtn  then
Think about this. You are inquiring of LC for the hilite of, say, "adocs3".

You probably intended to inquire about the hilite of BUTTON "adocs3", right?

I bet the other issues in your code have similar problems.

Craig

Post Reply