October 6, 200619 yr Newbies 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.
October 6, 200619 yr 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, 200619 yr by Guest
October 6, 200619 yr 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)]
October 10, 200619 yr Author Newbies 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
Create an account or sign in to comment