Clone Stack problems

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
ale870
Posts: 250
Joined: Tue Apr 22, 2008 9:17 am
Contact:

Clone Stack problems

Post by ale870 » Thu Mar 18, 2010 4:21 pm

Hello,

I'm cloning a stack, since I need to create an exact copy of a substack. Now I found to big problems:

1) New stack created (cloned) is a main stack.
2) New stack created (cloned) has the same ID of the original substack!

It means I cannot assign the new stack as a substack (change "mainStack" property).

Please help me since I cannot continue to work, and this is a key-feature for me!

Thank you for your help.
Runtime Revolution Widgets, tutorials, tips & tricks and more!
http://runrevwidgets.com/wiki

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Clone Stack problems

Post by bn » Thu Mar 18, 2010 8:41 pm

ale870,
although I dont quite understand what you are doing, you can change the id of a stack,

Code: Select all

set the id of stack "Copy of s2" to 11111
maybe that helps
regards
Bernd

ale870
Posts: 250
Joined: Tue Apr 22, 2008 9:17 am
Contact:

Re: Clone Stack problems

Post by ale870 » Thu Mar 18, 2010 10:18 pm

Thank you!
I tried reassign the code but I could not do that.
Now I tried again and I found that I assigned low numbers (RunRev requires an ID bigger than the current id number).
Now as workaround I'm using altid.

Thank you for your tip!
Runtime Revolution Widgets, tutorials, tips & tricks and more!
http://runrevwidgets.com/wiki

ale870
Posts: 250
Joined: Tue Apr 22, 2008 9:17 am
Contact:

Re: Clone Stack problems

Post by ale870 » Thu Mar 18, 2010 10:18 pm

Thank you!
I tried reassign the code but I could not do that.
Now I tried again and I found that I assigned low numbers (RunRev requires an ID bigger than the current id number).
Now as workaround I'm using altid.

Thank you for your tip!
Runtime Revolution Widgets, tutorials, tips & tricks and more!
http://runrevwidgets.com/wiki

ale870
Posts: 250
Joined: Tue Apr 22, 2008 9:17 am
Contact:

Re: Clone Stack problems

Post by ale870 » Thu Mar 18, 2010 10:20 pm

Thank you!
I tried reassign the code but I could not do that.
Now I tried again and I found that I assigned low numbers (RunRev requires an ID bigger than the current id number).
Now as workaround I'm using altid.

But the main problem is not solved (cloning stack RunRev does not generate a correct ID).

Thank you for your tip!
Runtime Revolution Widgets, tutorials, tips & tricks and more!
http://runrevwidgets.com/wiki

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Clone Stack problems

Post by mwieder » Fri Mar 19, 2010 6:16 pm

I also don't understand what you're trying to do or why you have a problem.

clone stack "mySubStack"
set the name of it to "myNewSubStack"
set the mainstack of stack "myNewSubStack" to "myMainStack"

Does that not do what you want? Why do you care about the id of the substack?

ale870
Posts: 250
Joined: Tue Apr 22, 2008 9:17 am
Contact:

Re: Clone Stack problems

Post by ale870 » Fri Mar 19, 2010 6:26 pm

Because it seems RunRev 4.5-dp3 create a new stack with the same id of the old one, and when I refer to it, RunRev cannot manage it since the IDs are the same :-(
Runtime Revolution Widgets, tutorials, tips & tricks and more!
http://runrevwidgets.com/wiki

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Clone Stack problems

Post by mwieder » Fri Mar 19, 2010 6:46 pm

You shouldn't be referring to stacks by id. Ever. A new stack will *always* have an id of 1002. The code I posted works fine. Rev has no problems accessing substacks, even with the same id. The problem is with your code.

ale870
Posts: 250
Joined: Tue Apr 22, 2008 9:17 am
Contact:

Re: Clone Stack problems

Post by ale870 » Fri Mar 19, 2010 7:00 pm

My code is ok, since I changed working mode from stack name to stack altId, and now everything works.
I think there could be some problems in the new beta release 4.5 dp-3.

Thank you.
Runtime Revolution Widgets, tutorials, tips & tricks and more!
http://runrevwidgets.com/wiki

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Clone Stack problems

Post by mwieder » Fri Mar 19, 2010 7:08 pm

Stack name should still work fine.

But yes, there are major problems with 4.5dp3. As there were with dp2. They're both beta - if you find problems, you should log them in the QCC.

Post Reply