Stacks and cards

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

Post Reply
Neurox66
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 120
Joined: Tue May 22, 2012 1:57 pm
Contact:

Stacks and cards

Post by Neurox66 » Tue Nov 12, 2013 9:49 am

Hi,

I work with many stacks and cards,
how do I determine which card is it open?

Thanks,
Paolo
Paolo Borzini | paolo@borzini.it
The WhiteFly Software | www.thewhitefly.it
Service on line for printers | www.4pellicole.it

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Stacks and cards

Post by jmburnod » Tue Nov 12, 2013 10:57 am

Ciao paolo,
many stacks and cards
Why not a global like gMyCurrentCard with an "initCurCD" handler in each stack ?

Code: Select all

global gMyCurrentCard
on initCurCD
   put the long name of this cd into gMyCurrentCard
end initCurCD
or a function return the long name of the current cd ?

Best

Jean-Marc
https://alternatic.ch

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Stacks and cards

Post by dunbarx » Tue Nov 12, 2013 4:21 pm

Hi.

Or you might just place a handler in a backscript, something like:

on opencard
put the number of this card && the name of this card && the name of this stack
end opencard

This will put all that into the msg box. You can always put the information somewhere else.

Craig Newman

Neurox66
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 120
Joined: Tue May 22, 2012 1:57 pm
Contact:

Re: Stacks and cards [Solved]

Post by Neurox66 » Wed Nov 13, 2013 6:42 pm

Thanks for suggestions,
I can't use the command "current card" because I've opened four card at same time.
I've created a function that updates (add/delete) a global variable with all the cards open.

Paolo
Paolo Borzini | paolo@borzini.it
The WhiteFly Software | www.thewhitefly.it
Service on line for printers | www.4pellicole.it

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Stacks and cards

Post by dunbarx » Wed Nov 13, 2013 6:50 pm

Hi.

Whatever works for you.

When you say you have four cards open, what that really means is that you have four stacks open in four windows. The "topStack" is the one with focus.

Just so you know how it goes, the line of code I sent before could always be modified to say:

put the number of this card && the name of this card && the name of the topStack

Craig

Post Reply