Name of 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
shalu
Posts: 72
Joined: Fri Mar 20, 2015 1:05 pm

Name of card

Post by shalu » Wed Apr 27, 2016 7:59 am

Hi,

How to change the name of the card. when I press control+n. If the first card name is "NEW" then the second card should be "New1" and third card name is "NEW2" etc is it possible

Thanks
Shalu
--
Thanks
Shalu S

atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm

Re: Name of card

Post by atout66 » Wed Apr 27, 2016 8:45 am

I, not sure if I understand all the meaning of your question, but by script you can change the name of the card that way:

Code: Select all

set the short name of this card to "theNameYouWant"
Cheers, Jean-Paul.
Discovering LiveCode Community 6.5.2.

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

Re: Name of card

Post by dunbarx » Wed Apr 27, 2016 3:34 pm

Hi.

Much depends upon where you are in your stack when you create a new card. The new one is placed after the one you are already on. So if you trapped the "newCard" message and did something like this:

Code: Select all

set the name of this card to "New" && the number of cards
you would be out of sort order. But of course you can always sort cards later. Something like

Code: Select all

on mouseUp
   sort cards   numeric by char -2 of the name of this card 
end mouseUp
Now why the "-2"?

Craig Newman

Post Reply