get the name of the card in wherein it is

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
problème
Posts: 77
Joined: Fri Oct 23, 2015 12:03 am

get the name of the card in wherein it is

Post by problème » Tue Dec 08, 2015 6:42 am

Hello,
I am on a card "myCard" and i want get his name so i don't this :

Code: Select all

command getCardName
   put the name of this card into nom
   delete char 0 to 5 of nom
   put nom is "myCard" 
end getCardName
I get result false

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: get the name of the card in wherein it is

Post by Thierry » Tue Dec 08, 2015 7:01 am

you can try this:

Code: Select all

put the short name of this card is "myCard"
less work, and no quotes involved around the card name..

Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

problème
Posts: 77
Joined: Fri Oct 23, 2015 12:03 am

Re: get the name of the card in wherein it is

Post by problème » Tue Dec 08, 2015 8:17 am

thanks for your help

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: get the name of the card in wherein it is

Post by Thierry » Tue Dec 08, 2015 9:21 am

problème wrote:thanks for your help
Je vous en prie :)

In case you're interested to make your code working,
you need to 'unquote' your var, i.e:

Code: Select all

    put the name of this card into nom
   delete char 0 to 5 of nom
   put (char 2 to -2 of nom) is "myCard"

Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

Post Reply