Mainstack becomes Substack

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
pascalh4
Posts: 81
Joined: Thu Aug 22, 2013 12:50 pm

Mainstack becomes Substack

Post by pascalh4 » Fri Sep 06, 2013 5:43 pm

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

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Mainstack becomes Substack

Post by Klaus » Fri Sep 06, 2013 6:13 pm

Hi Pascal,

just force Livecode to do the right thing :D
...
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

pascalh4
Posts: 81
Joined: Thu Aug 22, 2013 12:50 pm

Re: Mainstack becomes Substack

Post by pascalh4 » Fri Sep 06, 2013 8:11 pm

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

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Mainstack becomes Substack

Post by Klaus » Sat Sep 07, 2013 11:13 am

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! :D


Best

Klaus

pascalh4
Posts: 81
Joined: Thu Aug 22, 2013 12:50 pm

Re: Mainstack becomes Substack

Post by pascalh4 » Sat Sep 07, 2013 12:46 pm

Ok
Well understood.

Thank you.

Pascal

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Mainstack becomes Substack

Post by Klaus » Sat Sep 07, 2013 1:40 pm

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! :D

***There ARE some bugs there! 8)


Best

Klaus

pascalh4
Posts: 81
Joined: Thu Aug 22, 2013 12:50 pm

Re: Mainstack becomes Substack

Post by pascalh4 » Sat Sep 07, 2013 3:43 pm

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

Post Reply