Checkboxes

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
PoLyGLoT
Posts: 105
Joined: Sat Jan 14, 2012 12:37 am

Checkboxes

Post by PoLyGLoT » Sat Aug 25, 2012 10:25 pm

Hi all,

Normally, I group radio buttons together and use code such as "set the hilitedbutton of group BLAHBLAH to 0" or "put the hilitedbutton of group BLAHBLAH after data".

However, now I need to use checkboxes wherein ALL 4 options could be selected. If I use the code above, only the first option gets reported in data.

Any help is appreciated. Thank you.

Klaus
Posts: 14212
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Checkboxes

Post by Klaus » Sat Aug 25, 2012 11:06 pm

Hi,

you need to check "the hilite of btn X" manually, maybe in a repat loop.
Like this:

Code: Select all

...
repeat with i = 1 to 4
  put the hilite of btn ("checker" & i) & CR after tList
end repeat
## Get rid of trailing CR
delete char -1 of tList
...
Now you have CR delimited list with the hilites of your buttons.
Example
true
false
false
true

You get the picture :D


Best

Klaus

PoLyGLoT
Posts: 105
Joined: Sat Jan 14, 2012 12:37 am

Re: Checkboxes

Post by PoLyGLoT » Sun Aug 26, 2012 12:41 am

Thank you. Your code allowed me to configure things correctly. (I set it up so that it transformed the "true" and "false" to "1"s and "0"s, and did not delimit them on individual lines but with commas).

:)

Klaus
Posts: 14212
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Checkboxes

Post by Klaus » Sun Aug 26, 2012 11:45 am

Hi,

a COMMA separated list is also fine :D
Whatever works for you!


Best

Klaus

Post Reply