To get the topmost stack I have to use topStack...

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

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

To get the topmost stack I have to use topStack...

Post by Mag » Wed Jul 09, 2014 8:16 am

...to get the current card I have to use...

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

Re: To get the topmost stack I have to use topStack...

Post by Klaus » Wed Jul 09, 2014 11:17 am

Monsieur? :shock:

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: To get the topmost stack I have to use topStack...

Post by Mag » Wed Jul 09, 2014 11:23 am

:D :lol: :roll: :shock:

Maybe

Code: Select all

the current card name -- pseusocode

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

Re: To get the topmost stack I have to use topStack...

Post by Klaus » Wed Jul 09, 2014 11:53 am

Maybe this:
...
put the short name of this cd of the defaultstack into tCurrentCard
...
?

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: To get the topmost stack I have to use topStack...

Post by Mag » Wed Jul 09, 2014 1:31 pm

Hi Klaus, thanks. The fact is that the code is on a card that is not in foreground :mrgreen:

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

Re: To get the topmost stack I have to use topStack...

Post by Klaus » Wed Jul 09, 2014 1:48 pm

Mag wrote:Hi Klaus, thanks. The fact is that the code is on a card that is not in foreground :mrgreen:
The code? Soory, no idea what you try to achieve?

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: To get the topmost stack I have to use topStack...

Post by Mag » Wed Jul 09, 2014 1:51 pm

Hi Klaus,

I have a handler in a card where there is the need to know what is the current card displayed. And, no... the card displayed is not the one that contains the running code... :roll:

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

Re: To get the topmost stack I have to use topStack...

Post by Klaus » Wed Jul 09, 2014 1:52 pm

Hm, if:
...
put the short name of this cd of the defaultstack into tCurrentCard
...
is not what you need, then I have still no idea!?

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: To get the topmost stack I have to use topStack...

Post by Mag » Wed Jul 09, 2014 1:56 pm

Hi Klaus, isn't "this card" used to refer to the card where the code is running? Actually I need to know the name of the card which is the current frontmost card. :oops: :cry:

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

Re: To get the topmost stack I have to use topStack...

Post by Klaus » Wed Jul 09, 2014 1:59 pm

Mag wrote:Hi Klaus, isn't "this card" used to refer to the card where the code is running? Actually I need to know the name of the card which is the current frontmost card. :oops: :cry:
Ah, I think I get it...

But how do you call that namely script and what is in it?
Means, please post the code.

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: To get the topmost stack I have to use topStack...

Post by Mag » Wed Jul 09, 2014 2:04 pm

Hi Klaus, the code is called by a menu item, that menus are located in a different card. The code is simple, a thing like this one:
copy word -3 to -1 of field "output"

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

Re: To get the topmost stack I have to use topStack...

Post by Klaus » Wed Jul 09, 2014 2:25 pm

Sorry, still no way!?

How can you select a menu item on card X, but exspect card Y to be the current card? :shock:

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: To get the topmost stack I have to use topStack...

Post by Mag » Wed Jul 09, 2014 3:25 pm

Because the menu is a pulldown menubar menu on OS X! :mrgreen:

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

Re: To get the topmost stack I have to use topStack...

Post by Klaus » Wed Jul 09, 2014 3:29 pm

OK last try! :D

Does this do what you want:

Code: Select all

on menupick xyz
  ...
  set the defaultstack to the topstack

  ## COPY will only copy SELECTED text!
  set the clipboarddata["text"] to (word -3 to -1 of field "output")
...
?

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: To get the topmost stack I have to use topStack...

Post by Mag » Wed Jul 09, 2014 3:37 pm

Thank you Klaus! I almost feel sorry that we have found a solution, it was fun! :D :lol: :mrgreen: :wink: :P

Post Reply