Page 1 of 1

check boxes

Posted: Fri Mar 13, 2009 9:04 am
by smash
now i have spent all day trying hundreds of combinations, and i dont think i am even close.
i have about 30 check boxes, and i would like what ever check box is ticked, say 5 of them, i would like to push a button to send the ticked boxes to ONE text entry field on another card.
example, each check box has its own name "btnNovice1.1, btnNovice1.2 and so on" and the labels simply read 1.1 or 1.2 and so on.

now this is my last script i have tried (with no pleasure at all)
on mouseUp

repeat with i = 1 to the number of buttons of this card
if the style of button i is "checkbox" and the hilite of me is true then
put the highlight name of i "checkbox" into field "Test" of card "EntriesInvoice"


go to card "EntriesInvoice"
end if
end repeat
end mouseUp
i have one text field, that i would like them to go in if the have been ticked
like this
(1.1, 1.2, 1.3)

now am i even close ???? or am i way way off with my thinking ?
cheers

Posted: Fri Mar 13, 2009 9:24 am
by Klaus
Hi Smash,

you already partly answered your question :)

try this:

Code: Select all

on mouseUp

  ## We will store all the LABELS of the hilited checkboxes into a variable b_list first
  ## and will put them into the field AFTER we have collected all of them!
  put empty into b_list
  repeat with i = 1 to the number of buttons of this card 
   if the style of button i = "checkbox" and the hilite of BUTTON i = true then 
     put the LABEL of btn i &"," after b_list
   end if
  end repeat

  ## Get rid of trailing KOMMA
  delete char -1 of b_liste
  put b_list into field "Test" of card "EntriesInvoice" 

  ## This has to be put OUTSIDE of the repeaet loop, of course!
  go to card "EntriesInvoice" 
end mouseUp
Best from germany

Klaus


P.S.
Thanks a LOT for not using "lol" at all in this post :wink:

Posted: Fri Mar 13, 2009 10:07 am
by smash
good evening klaus from germany
ok i copied and pasted that
AND IT WORKS A TREAT!!!!!!!!!!

i was just no where near close LOL

THANK YOU KLAUS
all the best to you

Posted: Fri Mar 13, 2009 10:28 am
by Klaus
Hi smash,
smash wrote:good evening klaus from germany
ok i copied and pasted that
AND IT WORKS A TREAT!!!!!!!!!!
I'm not surprised :)
smash wrote:...near close LOL
AHHH! You did it again :D

Have a nice evening, here it is 10:30 am.


Best

Klaus