Storing objects in custom properties

Richard Gaskin ambassador at fourthworld.com
Fri Mar 30 16:05:36 EDT 2007


Ian McKnight wrote:
> I have a number of groups containing a varying number of fields, ie 1
> group would have 6 fields, another group 35 fields and yet another 50
> fields. I want the user to be able to select any of these groups they
> wish and place them on a card.
> 
> My initial thought was to store the groups on a separate card and copy
> the chosen group as required or hide them on the same card  but then I
> thought 'Why not put them into custom properties?'
> 
> My problem is that I can't get it to work. I can put values, images,
> files into custom props but not groups or field objects. Have I, as I
> suspect, come across one of the few things that you can't put into a
> custom prop or am I missing something?

You can store a stack file in a custom property, but I don't know of a
way to store individual controls there.

You may find the copy command will do what you need quite handily, since
it lets you specify a target for the copy:

   copy <obj> to <dest>

e.g.:

   copy grp 1 of stack "TemplateParts" to this cd of stack "UserStack"

When using the "to" option with the copy command it doesn't affect the
user's clipboard, making it really convenient for both you and your user.

-- 
  Richard Gaskin
  Managing Editor, revJournal
  _______________________________________________________
  Rev tips, tutorials and more: http://www.revJournal.com




More information about the use-livecode mailing list