The group command

Peter Haworth pete at mollysrevenge.com
Mon Feb 21 02:18:35 EST 2011


Thanks to all for the input.  I should have provided more context so here goes in pseudo code.

- create a datagrid and its template by script
- issue a group command naming the datagrid
- refer to the "last group" to rename it
- the "last group" is a group named "dghorizontals' within the datagrid, not the one created by the group command.  I don't know its layer because it is somehow hidden from the Application Browser.

As Jacqueline mentioned, the "it" variable doesn't help here since I'm not using the create command.  I have worked around the problem by using the last line of the groupIDs property, which seems to be sorted in ID order although I'd like to get confirmation of that.  My problem, yet again, is the dictionary, which in the group command description says:

  Tip:  To refer to the newly-created group, use the last keyword:

  group button "Yes" and button "No"
  set the name of last group to "Do It"

Clearly in my case, and from the posts on this topic, that is not reliable.

I like the idea of using the templateGroup, I think I will use that method.

  
Pete Haworth







On Feb 20, 2011, at 10:24 PM, J. Landman Gay wrote:

> On 2/20/11 10:37 PM, Richard Gaskin wrote:
>> dunbarx wrote:
>> 
>> > It is not stable. Scott is correct in that we all agreed that the
>> > only reliable workaround was to use the templateGroup to advantage.
>> 
>> Sorry, but I missed that meeting: under what circumstances does the
>> local var "it" not contain the long id of the newly-created group object
>> when "it" is checked as the very next action following a "create group"
>> command"?
>> 
> 
> When you aren't using "create", the "it" variable has no value:
> 
>  select control 1 and control 2
>  group
>  put it
> 
> Produces nothing.
> 
> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 





More information about the use-livecode mailing list