LC makes my stack a 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: Klaus, FourthWorld, heatherlaine, kevinmiller

oldummy
Posts: 97
Joined: Mon Jun 13, 2016 3:21 pm

LC makes my stack a substack

Post by oldummy »

This problem harkens back to the problem I encountered earlier that still exists, but if someone here can help me I believe if someone here can explain this to me, it will fix my original issue.
I have two stacks residing in the same folder. One is destined to be the application stack. It is simply a means to navigate to the second stack.The second is destined NOT to be a substack.
When I open the first stack, it is it's own mainstack as it should be. When I navigate to the second stack, the inspector says it is a substack of the first stack.
If I click "make Mainstack" it does change to be it's own mainstack.Ok.
Now when I try to save the second stack, windows asks me if I want to replace that stack. Click yes,save and exit.
Now I cannot navigate to the second stack from the first stack.
Instead, I get this error from LC:
Handler: error in statement
Field
go stack "Jukebox2"
mouseup
I have uninstalled and reinstalled LC twice while battling this.
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Re: LC makes my stack a substack

Post by richmond62 »

OK, OK: probably I am being a bit stupid as usual, so please could you explain HOW you open the second stack from the first stack?
-
Screenshot 2024-03-26 at 14.39.46.png
-
As THAT does something very odd indeed:
-
Screenshot 2024-03-26 at 14.42.12.png
Screenshot 2024-03-26 at 14.42.12.png (71.01 KiB) Viewed 6168 times
-
I have NO idea what that stack "revCo..." is. 8)

This, on the other hand works perfectly, with no nonsense about stack "Stack TWO" being a substack of anything:
-
Screenshot 2024-03-26 at 14.44.36.png
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10507
Joined: Wed May 06, 2009 2:28 pm

Re: LC makes my stack a substack

Post by dunbarx »

Hi.

So you want two stacks, the first being your "splash" stack and the second being your "working" stack (or stacks).

Make sure that each resides in its own separate stack file. Each must live that way. If they are currently not, change them.

Craig
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: LC makes my stack a substack

Post by jacque »

There is no syntax error in the reported statement. Can we see the whole handler that opens the second stack?

It may be that LC is looking for the stack in the defaultfolder, which is normally LC's application folder. But in that case I'd expect a "can't find stack" error.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
oldummy
Posts: 97
Joined: Mon Jun 13, 2016 3:21 pm

Re: LC makes my stack a substack

Post by oldummy »

It is a simple mouseup handle.

Code: Select all

on mouseup 
go stack "jukebox"
end mouseup
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10507
Joined: Wed May 06, 2009 2:28 pm

Re: LC makes my stack a substack

Post by dunbarx »

@oldDummy.

What is different, apart from the name, between:

Code: Select all

go stack "Jukebox"
and:

Code: Select all

go stack "Jukebox2"
??

Craig
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: LC makes my stack a substack

Post by jacque »

When you made the substack into a mainstack, did you also save the original mainstack? If not, then the substack may still be there. I believe LC moves the substack out to a new mainstack and deletes the one embedded in the first mainstack, but if you don't save it the substack will remain.

Try this:
Check that you have a stack "Jukebox.livecode" in the same folder.
Use the project browser to confirm the substack still exists in the first mainstack. If so, delete it.
Save the mainstack.
Close and remove it from memory [in the File menu]
Reopen the mainstack.
Change the field handler to: go stack "Jukebox.livecode"
Try the handler again.

If that still doesn't work then LC is probably looking in the wrong folder. Add an openStack handler in the main splash stack:

Code: Select all

on openStack
  set the defaultfolder to specialFolderPath("resources")
end openStack
Save the mainstack,, close and remove from memory, and then reopen it and try the handler again.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
oldummy
Posts: 97
Joined: Mon Jun 13, 2016 3:21 pm

Re: LC makes my stack a substack

Post by oldummy »

The jukebox and jukebox 2 issue was just me experimenting with saving the stack as a different name and then exchanging it with the existing stack with a change in the go stack script.
That did not work either.
I believe I've tried adding the .livecode to the name but I will try it to make sure.
Thanks folks.
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Re: LC makes my stack a substack

Post by richmond62 »

Just to be awkward, and return to the original posting:

Why can't one of the stacks be a substack of the other one?
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10507
Joined: Wed May 06, 2009 2:28 pm

Re: LC makes my stack a substack

Post by dunbarx »

Richmond.

Unless any stacks apart from the executable stack are in separate stack files, they won't save changes. Substacks don't cut it.

Craig
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Re: LC makes my stack a substack

Post by richmond62 »

Mind you, you can save data to, say, a text file.
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10507
Joined: Wed May 06, 2009 2:28 pm

Re: LC makes my stack a substack

Post by dunbarx »

Mind you, you can save data to, say, a text file.
Yep, that is the "other" way to do it, likely a favorite for many. I like the splash method.

Craig
oldummy
Posts: 97
Joined: Mon Jun 13, 2016 3:21 pm

Re: LC makes my stack a substack

Post by oldummy »

I am going to trash it all as I feel somehow I have corrupted it. My intention now is simple to remake them both and copy every script and object to make another pair of stacks and try the build again.
Thank you all for your suggestions!
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: LC makes my stack a substack

Post by jacque »

I suspect the problem isn't corruption, but if the new stacks fail in the same way then I'd be happy to take a look at them and see if I can find the problem. Or send them now if you want to avoid reproducing everything.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10507
Joined: Wed May 06, 2009 2:28 pm

Re: LC makes my stack a substack

Post by dunbarx »

oldDummy.

I agree with Jacque, it is not a corruption thing. Somehow it is a problem with LC "finding" the other stack. Currently, are you certain that your mainStack and your "other" stack are both mainStacks, and each live their own stack files? And this would not matter until you create a standalone.

But in the IDE, it should not matter. You might try re-creating that second stack from scratch with a new name, and see if you can navigate to it.

Craig
Post Reply