grouping objects by script problem

ron barber runrevron at gmail.com
Tue Oct 23 23:15:12 EDT 2007


Hi Klaus
Thank you for your reply. I tried your script and my implementation of
it hung after it  created the second graphic. It created the first,
moved it, then selected it, then created the second and stopped.
Interestingly, when I walked through it with the debugger, it went
fine...

I tried creating everything in one loop and then setting the selected
of everything in another loop. This worked but was slower than the do.
I'm not sure what Eric did that got the 5x speed up. He is right about
the number of objects relating to the time and one would expect that.
I had been hiding the wd and of course that did speed things up
compared to watching every field and graphic get created and placed
,but the real speed up came when I locked messages before creating and
selecting all the objects. It rendered time difference between the
"select as you go" and the "do" method insignificant. It went from
60-90 tics to less than 5 for both methods so I'm a happy scripter.

Thanks
Ron

On Oct 23, 2007, at 7:03 PM, Klaus Major wrote:

> I have been trying to group a set of controls and graphic objects
> after creating them via script but can't seem to find out what I'm
> doing wrong.
> Here's the relevant part of the script:

another option especially for this situation would be:

repeat
--do some other stuff here--
     create graphic tname
     set the selected of grc tname to true
    end repeat
 group
 select empty
...

No hassle with "do" and strings and stuff :-)



More information about the use-livecode mailing list