Current Card

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
A1Qicks
Posts: 79
Joined: Sat Dec 26, 2015 10:47 am

Current Card

Post by A1Qicks » Sat Feb 27, 2016 4:55 pm

Probably something simple in the dictionary - but if I knew where to look I'd already have the answer.

If I have a script in the stack and I want it to act differently depending on what the current front card is, how do I do this?

So a message comes in from a socket, and the stack reads the message, and if it's on "Card 1" it'll send it to to "Field 1" and if it's on "Card 2" it'll ignore it.

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: Current Card

Post by quailcreek » Sat Feb 27, 2016 5:14 pm

You can use the ID of this or the short name of this cd to suit your needs.

Code: Select all

on preOpenStack
   runMe
end preOpenStack

on runMe
   switch the short name of this cd
      case "Fred"
         -- do the stuff related to this cd
         break
         
      case "Wilma"
         -- do the stuff related to this cd
         break
   end switch
end runMe
Tom
MacBook Pro OS Mojave 10.14

A1Qicks
Posts: 79
Joined: Sat Dec 26, 2015 10:47 am

Re: Current Card

Post by A1Qicks » Sat Feb 27, 2016 5:40 pm

Perfect. Thanks!

Post Reply