Any suggestions?

Peter M. Brigham pmbrig at gmail.com
Sun Jul 22 13:26:47 EDT 2012


On Jul 22, 2012, at 12:31 PM, Charles Szasz wrote:

> I have the following group script for 19 checkboxes which puts the names of 19 checkboxes into a field "final" when they are checked. However due to size restrictions of my window, I need to have the names of checkboxes to appear in an additional field when the first field cannot hold all of the checkbox names. I don't want to use scrollbars in my first field. How can I do this?
> 
> on mouseUp
>   put the number of buttons of me into nbr
>   repeat with n = 1 to nbr
>      put the short name of button n of me into tName
>      if not the hilite of button n of me then next repeat
>      put tName & cr after theList
>   end repeat
>   put theList into field "final"
>   repeat with i = 1 to the number of lines in field "final"
>      put i &"."& space before line i of field "final"
>   end repeat
> end mouseUp

maybe:

on mouseUp
  put the number of buttons of me into nor
  put 1 into counter
  repeat with n = 1 to nbr
     if not the hilite of button n of me then next repeat
     -- the above line could go first
     put the short name of button n of me into tName
     put counter "." && tName & cr after theList
     -- combine the two repeat loops
     add 1 to counter
  end repeat
  put line 1 to -1 of theList into theList -- no trailing return
  put line 1 to tCutoff of theList into field "final"
  -- tCutoff is the number of lines fitting into the first fld
  put line tCutoff + 1 to -1 of theList into theRest
  if theRest <> empty then
     put theRest into fld "final2"
     show fld "final2"
  end if
end mouseUp

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig





More information about the use-livecode mailing list