determine the current card of another stack

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

Post Reply
Martin Koob
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 256
Joined: Sun May 27, 2007 8:19 pm

determine the current card of another stack

Post by Martin Koob » Fri Aug 07, 2015 9:00 pm

Is there a way to determine the current card of another stack?

current card returns the name of the current card of the current stack.

If you have two stacks open, the main stack and a substack can you determine from the main stack what the current card of the substack is?

I know this does not work

the current card of stack "my substack"

Martin

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: determine the current card of another stack

Post by bn » Fri Aug 07, 2015 10:35 pm

Hi Martin,

try

Code: Select all

put the name of the current card of  stack "mySubStack"
will put the name of the current card of your substack into the message box

Kind regards

Bernd

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: determine the current card of another stack

Post by Klaus » Sat Aug 08, 2015 12:15 pm

Hi Martin,

you can also set "the defaultstack" (maybe not so helpful in this example, but anyway):
...
set the defaultstack to "name of other stack, which is currently not the topstack"
put the name of THIS cd into tCardName
set the defaultstack to "THIS STACK"
## now continue to work on in THIS stack...
...
You get the picture :D


Best

Klaus

Martin Koob
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 256
Joined: Sun May 27, 2007 8:19 pm

Re: determine the current card of another stack

Post by Martin Koob » Sat Aug 08, 2015 3:37 pm

Thanks Bernd and Klaus.

Setting the defaultStack is something I did not realize you could do. Interesting.

Martin

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: determine the current card of another stack

Post by jacque » Sun Aug 09, 2015 4:44 pm

Try currentCard (one word. )

Code: Select all

get the currentCard of stack "other stack" 
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Martin Koob
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 256
Joined: Sun May 27, 2007 8:19 pm

Re: determine the current card of another stack

Post by Martin Koob » Sun Aug 09, 2015 5:03 pm

Thanks Jacque.

That works too.

Oddly, I couldn't find currentCard in the dictionary. Then I found someone had posted a documentation bug

http://quality.runrev.com/show_bug.cgi?id=14651

I also found that someone had problem with using currentCard in some situations.

http://www.runrev.com/pipermail/use-liv ... 11584.html


Martin

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: determine the current card of another stack

Post by FourthWorld » Sun Aug 09, 2015 5:11 pm

jacque wrote:Try currentCard (one word. )]
I'm so used to camelCase portmonteaus in xTalks that I often find myself typing "the detailedFiles". There's probably a rule that would allow us to anticipate when a function is a single- or double-word expression, but it's probably a bit linguistically Chomsky for me to grasp. My simple mind just wishes it would be one way or the other.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply