Page 1 of 1

Buttons Names to show in a field

Posted: Sun Jan 30, 2011 6:59 pm
by bsouthuk
Hi I want to be able to display the names of all buttons within a group in a field. I am trying with the following code:

Code: Select all


put the num of buttons of grp "CompanyType" of group "Porrima" of  card 26 into num_fields
lock screen
repeat with i = 1 to num_fields
put the label of button i of grp "CompanyType" of group "Porrima" of card 26 into fld "test"
end repeat
unlock screen

However, only the name of the last button displays in the field. Obviously it appears that each time it repeats, the name of the following button is over writing the name of the previous one. Can anyone spot the problem in my code?

Thanks guys!

Re: Buttons Names to show in a field

Posted: Sun Jan 30, 2011 7:16 pm
by bangkok
That should do it :

put the label of button i of grp "CompanyType" of group "Porrima" of card 26 & CR after fld "test"

A carriage return to make a new line, and "after" rather then "into" (otherwise the next line replaces the previous)

Re: Buttons Names to show in a field

Posted: Sun Jan 30, 2011 11:09 pm
by bsouthuk
That's great thank you for your help!