Page 1 of 1
Stand Alone Application woes
Posted: Mon Oct 19, 2009 1:23 am
by chris9610
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?
Posted: Mon Oct 19, 2009 8:38 am
by Mark
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
Posted: Mon Oct 19, 2009 1:27 pm
by chris9610
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.
Posted: Mon Oct 19, 2009 1:47 pm
by Mark
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
Posted: Mon Oct 19, 2009 1:59 pm
by chris9610
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.
Posted: Mon Oct 19, 2009 2:17 pm
by chris9610
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.
Posted: Mon Oct 19, 2009 2:22 pm
by Mark
Hi chris9610,
Do you have *any* script anywhere in your project that is triggered when a stack closes?
Best,
Mark
Posted: Mon Oct 19, 2009 2:29 pm
by chris9610
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.
Posted: Mon Oct 19, 2009 2:56 pm
by chris9610
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.
Posted: Mon Oct 19, 2009 3:07 pm
by Mark
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
Posted: Mon Oct 19, 2009 6:43 pm
by chris9610
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.
Posted: Mon Oct 19, 2009 7:05 pm
by Mark
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
Posted: Mon Oct 19, 2009 8:00 pm
by chris9610
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.
Posted: Mon Oct 19, 2009 8:16 pm
by chris9610
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 .