Page 1 of 1
Mainstack becomes Substack
Posted: Fri Sep 06, 2013 5:43 pm
by pascalh4
Hi
yet another question.
In this code:
Code: Select all
create stack "F0" in stack "Outils de création"
set the loc of stack "F0" to (450,300)
ask "donner un titre"
if it=empty then exit to top
put it into Nvar
set the name of stack "F0" to ("F0" & " " & Nvar)
hide stack ("F0" & " " & Nvar)
go to stack "Outils de création"
create stack "F0"
set the name of stack "F0" to ("F0" & " " & Nvar)
If if I finish only these two lines, it's create a new MainStack
Code: Select all
go to stack "Outils de création"
create stack "F0"
But if I write he third line
Code: Select all
set the name of stack "F0" to ("F0" & " " & Nvar)
then, in the project browser, Mainstack becomes Substack. But not in the stack "Outils de création"
Is this normal ?
Pascal
Re: Mainstack becomes Substack
Posted: Fri Sep 06, 2013 6:13 pm
by Klaus
Hi Pascal,
just force Livecode to do the right thing
...
go to stack "Outils de création"
## Every CREATEd stack is in fact a aminstack at first!
create stack "F0"
## Do this:
set the mainstack of stack "F0" to "Outils de création"
## et voila: Substack

...
Best
Klaus
Re: Mainstack becomes Substack
Posted: Fri Sep 06, 2013 8:11 pm
by pascalh4
Hi Klaus
I think I explained my question wrong.
To force and place a substack in mainstack I can do and there is no problem.
But I wonder why mainstack "F0" created, becomes independent substack when the name is changed (with the third line of code)
note the complete code create.
- A first substack "F0" renamed, in a first mainstack "outil de création" .
-and a new mainstack "F0" wich renamed, should always be a mainstack.
But it becomes substack (in the browser) without mainstack. Why?
It is impossible to have a New Mainstack that has the same name as the substack of a previous Mainstack?
Pascal
Re: Mainstack becomes Substack
Posted: Sat Sep 07, 2013 11:13 am
by Klaus
Hi Pascal,
pascalh4 wrote:But it becomes substack (in the browser) without mainstack. Why?
I have absolutely no idea!
pascalh4 wrote:It is impossible to have a New Mainstack that has the same name as the substack of a previous Mainstack?
Not impossible, but this is asking for trouble! The engine cannot differ between two objects with the same name!
In other words: DON'T!
Best
Klaus
Re: Mainstack becomes Substack
Posted: Sat Sep 07, 2013 12:46 pm
by pascalh4
Ok
Well understood.
Thank you.
Pascal
Re: Mainstack becomes Substack
Posted: Sat Sep 07, 2013 1:40 pm
by Klaus
Hi Pascal,
pascalh4 wrote:But it becomes substack (in the browser) without mainstack. Why?
after reading this a second time, I think this is just a display bug*** in the "Project Browser",
because there cannot be a SUBSTACK without a MAINSTACK!
***There ARE some bugs there!
Best
Klaus
Re: Mainstack becomes Substack
Posted: Sat Sep 07, 2013 3:43 pm
by pascalh4
Hi Klaus
Well, to check that I'll try to continue my project (as there will be several new substack, maybe it will come back in order.
I will try.
Pascal