Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
shalu
- Posts: 72
- Joined: Fri Mar 20, 2015 1:05 pm
Post
by shalu » Thu Jun 09, 2016 1:10 pm
Hi ALL
I have some cards in Stack , I randomly go to each card, How I get the name or number of last visited card

--
Thanks
Shalu S
-
dunbarx
- VIP Livecode Opensource Backer

- Posts: 10305
- Joined: Wed May 06, 2009 2:28 pm
Post
by dunbarx » Thu Jun 09, 2016 1:40 pm
Hi.
You have to understand that a handler in the stack script can "see" what is happening as you navigate to certain cards. This involves an understanding of the nature of the message hierarchy.
In the stack script:
Code: Select all
on openCard
put the number of this card
end openCard/code]
This loads the message box, but it is up to you how you want to report the current card. You might display card names just as well, if they have them.
Craig
-
Klaus
- Posts: 14177
- Joined: Sat Apr 08, 2006 8:41 am
-
Contact:
Post
by Klaus » Thu Jun 09, 2016 1:44 pm
Hi Shalu,
what Craig said, but also check "recent" in the dictionary!
Best
Klaus
-
dunbarx
- VIP Livecode Opensource Backer

- Posts: 10305
- Joined: Wed May 06, 2009 2:28 pm
Post
by dunbarx » Thu Jun 09, 2016 1:51 pm
Hi.
What Klaus said, but note that "recent" as well would have to be placed in a handler in the stack script, for the same reasons. And that is most important; what I want you to learn solidly.
Craig
-
Klaus
- Posts: 14177
- Joined: Sat Apr 08, 2006 8:41 am
-
Contact:
Post
by Klaus » Thu Jun 09, 2016 1:59 pm
Hi Craig,
dunbarx wrote:...but note that "recent" as well would have to be placed in a handler in the stack script...

"go recent cd" in a button works fine! What am I missing?
Best
Klaus
-
dunbarx
- VIP Livecode Opensource Backer

- Posts: 10305
- Joined: Wed May 06, 2009 2:28 pm
Post
by dunbarx » Thu Jun 09, 2016 2:19 pm
Klaus, baby.
The stack would have to have that button on each card. The user would have to click after each navigation to see which card was in front. Perhaps it could be placed in a group with background behavior set to true? So that any new cards created would contain that fabulous functionality? Maybe the user could switch to assembly language?
Craig
-
Klaus
- Posts: 14177
- Joined: Sat Apr 08, 2006 8:41 am
-
Contact:
Post
by Klaus » Thu Jun 09, 2016 2:38 pm
Hi Craig,
dunbarx wrote:Klaus, baby.
dunbarx wrote:The stack would have to have that button on each card. The user would have to click after each navigation to see which card was in front. Perhaps it could be placed in a group with background behavior set to true? So that any new cards created would contain that fabulous functionality?
Maybe,but we do not know any details yet...
dunbarx wrote:Maybe the user could switch to assembly language?

I'm sure, that Shalu would not be amused!
Best
Klaus
-
FourthWorld
- VIP Livecode Opensource Backer

- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
-
Contact:
Post
by FourthWorld » Thu Jun 09, 2016 3:15 pm
The recentCards will return a list of the long IDs of recently-visited cards.
-
dunbarx
- VIP Livecode Opensource Backer

- Posts: 10305
- Joined: Wed May 06, 2009 2:28 pm
Post
by dunbarx » Thu Jun 09, 2016 4:28 pm