Looping over all buttons

Marty Knapp martyknapp at comcast.net
Wed Feb 22 12:12:29 EST 2012


Hey Mark,
Yes - I'd loop through and make a comma delimited list

repeat with x=1 to the number of btns
    put the hilite of btn x & comma after myHiliteList
end repeat

Then if you need to you can save that and use it to set the hilites at a 
later time.
Works for me.

Marty K
> Hi, I have 38 buttons on a form that I need to copy their hilite value to a
> temporary variable. Is it possible in LC to do something like
>
> for x = 1 to the number of buttons on card y
>     put the hilite of btn"x" into tButtonx
> end
>
> instead of writing out manually, 38 times:
>
>     put the hilite of btn"fhHypertension" into tButton4
>     put the hilite of btn"fhDiabetes" into tButton5
> etc
>
> Thanks
>
> -- Mark
>




More information about the use-livecode mailing list