Cloning objects

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
garyth123
Posts: 88
Joined: Sat Apr 27, 2013 11:14 am
Contact:

Cloning objects

Post by garyth123 » Mon Feb 17, 2014 11:06 am

Hi,

I have attempted to create a group on a card which I mean to use as a template. However I could not get the clone command to work by script. Instead I had to use

Code: Select all

   
...
repeat with i = 1 to 2
      
      copy grp "bookingtime" of cd "template card" to this card//this is instead of "clone"
      
      //position the group
      set the top of it to (86 + x*120)
      add 1 to x
      set the left of it to 40
...
I am probably missing some better way of achieving this.

Can anyone advise?

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Cloning objects

Post by Simon » Mon Feb 17, 2014 11:14 am

Hi,
How about setting the "Behave like background" on the group?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

garyth123
Posts: 88
Joined: Sat Apr 27, 2013 11:14 am
Contact:

Re: Cloning objects

Post by garyth123 » Mon Feb 17, 2014 11:20 am

Simon wrote:Hi,
How about setting the "Behave like background" on the group?

Simon
Well I have to create the cloned groups kind of "on demand", placing them, and updating the fields in them with information, as they scroll.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Cloning objects

Post by jmburnod » Mon Feb 17, 2014 11:21 am

Hi,
If i understand what you mean "place group" is an easy way to do that
Best regards
Jean-Marc
https://alternatic.ch

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Cloning objects

Post by Simon » Mon Feb 17, 2014 11:30 am

If i understand what you mean "place group"
Sweet... was even in the OP post
placing them,
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Cloning objects

Post by jmburnod » Mon Feb 17, 2014 12:10 pm

Hi Simon,
I understood "placing them" signified set the loc of new group.
Jean-Marc
https://alternatic.ch

Post Reply