Newbies unclejimbo Posted October 6, 2006 Newbies Posted October 6, 2006 Sorry if this seems a bit stupid - I'm a super neewbie. I'm trying to make a script for a 'back' button that will take the user back to the layout they just came from. I can't specify the destination layout explicitly because the layout with the 'back' button can be accessed from several locations. Any help would be much appreciated.
Inky Phil Posted October 6, 2006 Posted October 6, 2006 (edited) Hi Jimbo and welcome Set up a global field - 'G_Lastlayout' Whenever you move out of a layout perform a script that has one line Setfield [G_Lastlayout;Get(LayoutNumber)] Attach a script to your 'back' button also with 1 line Go to layout(G_LastLayout) and specify layout number by calculation (bottom r/h/s of script window) when you specify this step Hey presto! your back button will always take the user back to wherever they came from HTH Phil Edited October 6, 2006 by Guest
BobWeaver Posted October 6, 2006 Posted October 6, 2006 A slightly fancier version of what Phil said is to use the global field as a stack so that you can back up many levels like in a web browser. When you go to a new layout, set your global like this: Setfield [G_Lastlayout;Get(LayoutNumber) & ¶ & G_Lastlayout] When you click the back button, it performs this 2 line script: Go to layout(LeftValues(G_LastLayout;1)) Setfield [G_Lastlayout;MiddleValues( G_Lastlayout;2;99999)]
Newbies unclejimbo Posted October 10, 2006 Author Newbies Posted October 10, 2006 Hi guys, Thanks for the help, and the warm welcome. I've implemented Phil's suggestion and it worked a treat. I even had a rough idea of what I was doing! Bob's 'multiple backs' solution looks cool, but I think I'll walk for a bit before I try running. : Something for the To Do list. Cheers Jim
Recommended Posts
This topic is 6621 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now