Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6621 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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.

Posted (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 by Guest
Posted

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
Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.