More groups

Sarah sarahr at genesearch.com.au
Thu Feb 27 21:33:01 EST 2003


Hi Ken,

Try stepping through with the Script Debugger. You will see that Klaus' 
script builds a string from the list of objects in his field, using a 
repeat for each loop. So mylist_to_group ends up containing:
	field 3 and field 2 and button 2 and button 3 and
As it ends with an extra "and", he deletes the last word (word -1 means 
last word - you can use either syntax).
Then he adds the word "group" to the front of his list and uses "do" to 
perform the grouping.

Hope you don't mind me answering this one Klaus, but we're awake over 
here in Oz, while I figured you must be still asleep :-)

Cheers,
Sarah


>> supposed you have a list (field or var) of elements you want to group
>> like:
>>
>> field 3
>> field 2
>> button 2
>> button 3
>> ...
>>
>> Then you can script (i have a field here):
>>
>> on mouseUp
>> repeat for each line l in fld 1
>> put l && "and " after mylist_to_group
>> end repeat
>> delete word -1 of mylist_to_group
>> do "group" && mylist_to_group
>> ## do what you want to -> group -1
>> ## :-)
>> end mouseUp
>>
>> Tested and works :-)
>>
>> Hope that helps...
> ----------
> Thanks Klaus,
>
> I wish I could tell what's happening, though. I don't recognize the 
> actions
> of the syntax.
>
> Ken N.
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>





More information about the use-livecode mailing list