The group command

dunbarx at dunbarx at
Sun Feb 20 22:27:19 EST 2011

It is not stable. Scott is correct in that we all agreed that the only reliable workaround was to use the templateGroup to advantage. I wrote an addendum in the dictionary to the "last" keyword as it applies to groups:

The "last" keyword is not stable when referring to groups. So if one creates several groups, referencing the "last" group may not return the group actual ly created last. Using the "templateGroup" is a workaround, since when creating a new group one can, for example, set the name of the templateGroup to something unique, and be able to find the last group by name. Also, trapping the "newGroup" message with an appropriate script can be used to find the last group.

This is not an issue with other objects,

Craig Newman

-----Original Message-----
From: Richard Gaskin <ambassador at>
To: use-livecode at
Sent: Sun, Feb 20, 2011 9:56 pm
Subject: Re: The group command

Peter Haworth wrote: 
 > The dictionary says I can refer to the group created by the group 
 > command by using the last keyword as in "last group".  Has anyone 
 > used this successfully? 
As the others here have noted, it's possible to create a group such that it won't be ordinally last. 
Instead, you can take advantage of a convention the engines uses with reasonable consistency in which the local variable "it" will contain the long ID of a new object immediately after it's been created, e.g.: 
create grp; put it 
--   Richard Gaskin 
  Fourth World 
  LiveCode training and consulting: 
  Webzine for LiveCode developers: 
  LiveCode Journal blog: 
use-livecode mailing list 
use-livecode at 
Please visit this url to subscribe, unsubscribe and manage your subscription preferences: 


More information about the Use-livecode mailing list