lock recent

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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9356
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: lock recent

Post by richmond62 » Thu Jul 22, 2021 6:52 pm

could you not simply write
push

pop


Of course I could, but I had never heard or seen push or pop before this thread. :shock:

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Re: lock recent

Post by marksmithhfx » Thu Jul 22, 2021 8:30 pm

richmond62 wrote:
Thu Jul 22, 2021 6:52 pm
could you not simply write
push

pop


Of course I could, but I had never heard or seen push or pop before this thread. :shock:
I get that. While I might have seen them before, I think I must have forgotten about them. Anyway, thanks to Jacques many contributions on this topic, I have finally found an almost elegant solution. At least it is relatively succinct.

In the back button of the Settings page, where the User Guide starts, if I put this script then it does not re-enter the UG from the back button:

Code: Select all

on mouseUp
   -- check to see if the next card is in the UG list
   put the recentcards into tList
   put word 3 of line 2 of tList into string2
   if "405764,405766,405768,405771" contains string2 then
      go card "home"
   else
      go back 
   end if
end mouseUp
Thank you Jacque!!
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: lock recent

Post by jacque » Thu Jul 22, 2021 9:22 pm

That's how I would do it; ergo, I don't think it's inelegant. :D

If you ever add more non-UG cards to the stack you could push the current card before leaving for the UG, and then pop it in the Back button using your current script but substituting pop for the "go home" command.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Re: lock recent

Post by marksmithhfx » Fri Jul 23, 2021 1:27 pm

jacque wrote:
Thu Jul 22, 2021 9:22 pm
That's how I would do it; ergo, I don't think it's inelegant. :D

If you ever add more non-UG cards to the stack you could push the current card before leaving for the UG, and then pop it in the Back button using your current script but substituting pop for the "go home" command.
Very good suggestion. Thanks!

M
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”