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
-
chris9610
- Posts: 79
- Joined: Fri Mar 20, 2009 4:38 pm
Post
by chris9610 » Mon Oct 19, 2009 1:23 am
Here is the code I have problems with:
Code: Select all
on dologin pstack
put the substacks of this stack after tvar
repeat for each line aLine in tvar
close stack aline
end repeat
close this stack
go stack pstack
end dologin
In development mode this works good. All the substacks close. Once I compile the the stand alone the substacks do not close.
What am I doing wrong?
Developing with Windows XP & Revolution 4.5
-
Mark
- Livecode Opensource Backer

- Posts: 5150
- Joined: Thu Feb 23, 2006 9:24 pm
-
Contact:
Post
by Mark » Mon Oct 19, 2009 8:38 am
chris9610,
I think we need more information. Anything may be the cause of your problem. It is quite probable that your script is never called. That would mean that the code isn't in the script you posted, but in the script that calls your dologin handler.
Are the substacks visible when you try to close then, or invivisble? How do you check whether they actually close? I'm not sure that it is a good idea to close a stack before the script finishes. What about switching "close this stack" and "go stack pstacka"?
Do you see anything peculiar on screen, which is different in the standalone compared to the IDE?
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
chris9610
- Posts: 79
- Joined: Fri Mar 20, 2009 4:38 pm
Post
by chris9610 » Mon Oct 19, 2009 1:27 pm
Lets start with the structure of the Application:
Main stack is "Login"
Next main stack is the Application Menu which gets opened if the login is a success.
Login
App Menu
---substack to app menu
---substack to app menu
---substack to app menu
The script is in the App menu
The script does get called because the App Menu Closes
in development all substacks close then the App Menu Closes And the Login stack is Activated as expected. The Application Browser verifies the fact that the App Menu and it's subs close.
In the compiled mode No substacks are closed and the App Menu Closes and the Login is Activated. Leaving orphaned substacks.
The Application setup includes 2 main stacks:
Login and App Menu (with all its substacks). My goal is to close all substacks then close the menu and return to a login.
Developing with Windows XP & Revolution 4.5
-
Mark
- Livecode Opensource Backer

- Posts: 5150
- Joined: Thu Feb 23, 2006 9:24 pm
-
Contact:
Post
by Mark » Mon Oct 19, 2009 1:47 pm
chris9610,
Are the substacks visible when you try to close them, or invivisble? I'm not sure that it is a good idea to close a stack before the script finishes. What about switching "close this stack" and "go stack pstacka"?
Do you see anything peculiar on screen, which is different in the standalone compared to the IDE?
Best regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
chris9610
- Posts: 79
- Joined: Fri Mar 20, 2009 4:38 pm
Post
by chris9610 » Mon Oct 19, 2009 1:59 pm
Currently the substacks are visible, I did not try them while invisible and I will try changing the order so the App Menu is closed after the login Stack is opened.
Developing with Windows XP & Revolution 4.5
-
chris9610
- Posts: 79
- Joined: Fri Mar 20, 2009 4:38 pm
Post
by chris9610 » Mon Oct 19, 2009 2:17 pm
Well changing the order does not work in the development mode.
The substacks close, the Login stack flashes and then is gone and the App Stack Remains which means "Close This Stack" closes the current stack of Login.
So I changed it to close stack "MainMenuTree" and I am back to the runs good in development but orphan substacks in standalone.
Developing with Windows XP & Revolution 4.5
-
Mark
- Livecode Opensource Backer

- Posts: 5150
- Joined: Thu Feb 23, 2006 9:24 pm
-
Contact:
Post
by Mark » Mon Oct 19, 2009 2:22 pm
Hi chris9610,
Do you have *any* script anywhere in your project that is triggered when a stack closes?
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
chris9610
- Posts: 79
- Joined: Fri Mar 20, 2009 4:38 pm
Post
by chris9610 » Mon Oct 19, 2009 2:29 pm
OK I have simplified the issue. I made a button to close all substacks:
Code: Select all
on mouseUp
put the substacks of this stack after tvar
repeat for each line aLine in tvar
close stack aline
end repeat
end mouseUp
The button works great in development mode and does not close substacks in the standalone.
Note: The application structure is the same I just added a button to the card to test it.
Developing with Windows XP & Revolution 4.5
-
chris9610
- Posts: 79
- Joined: Fri Mar 20, 2009 4:38 pm
Post
by chris9610 » Mon Oct 19, 2009 2:56 pm
Ok I think I have found the problem.
In the standalone settings I had it saving substacks as separate files. Closing substacks fails in this setup.
Compiling it to one file and then closing substacks works.
Developing with Windows XP & Revolution 4.5
-
Mark
- Livecode Opensource Backer

- Posts: 5150
- Joined: Thu Feb 23, 2006 9:24 pm
-
Contact:
Post
by Mark » Mon Oct 19, 2009 3:07 pm
chris9610,
Obviously, I didn't think of that. I wish we had some sort of checklist for this kind of problems. Anyway, I'm glad you solved it.
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
chris9610
- Posts: 79
- Joined: Fri Mar 20, 2009 4:38 pm
Post
by chris9610 » Mon Oct 19, 2009 6:43 pm
What I was not aware of is the fact that you loose functionality depending on how you setup your standalone applications.
This may be a bug or not. I have not found any documentation on this. I was hoping to add update abilities to the substacks but now it looks like I have to plan on updating the main stack.
These things are important considerations while building an application.
Developing with Windows XP & Revolution 4.5
-
Mark
- Livecode Opensource Backer

- Posts: 5150
- Joined: Thu Feb 23, 2006 9:24 pm
-
Contact:
Post
by Mark » Mon Oct 19, 2009 7:05 pm
chris9610,
I wouldn't call this a bug. If your scripts call an object, but the object doesn't exist anymore, then it is an error of the programmer, not a RunRev bug. You have to make sure that the objects are available, be it fields, buttons or stacks.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
chris9610
- Posts: 79
- Joined: Fri Mar 20, 2009 4:38 pm
Post
by chris9610 » Mon Oct 19, 2009 8:00 pm
But the substacks did exist and continued to operate without the main stack.
I just could not close them from the main stack.
Maybe I needed to use the long name once the substacks are separated during assembly of the standalone.
Developing with Windows XP & Revolution 4.5
-
chris9610
- Posts: 79
- Joined: Fri Mar 20, 2009 4:38 pm
Post
by chris9610 » Mon Oct 19, 2009 8:16 pm
Ok I think I get it now.
When you build the standalone and put a check mark in the box to Move Substacks into Individual Stack Files then there are no substacks.
The substacks become new main stacks as far as the standalone is conserned.
So I think I know how to work with this by closing all open stacks except the Login .
Developing with Windows XP & Revolution 4.5