Creating cards

J. Landman Gay jacque at hyperactivesw.com
Sun Feb 26 16:22:00 EST 2006


Gordon Webster wrote:

> I created a function to add a named card to a stack like this:
> 
> function addCard cardname
>   create card cardname
> end addCard
> 
> When I run it from the message box like this: addCard("AnotherCard"),
 > it creates the new card twice!
> 
> Before I run this function, the 'cardnames' of my stack looks like this:
> 
> MyFirstCard
> 
> Afterwards, it looks like this:
> 
> MyFirstCard
> AnotherCard
> AnotherCard
> 
> Any ideas why it creates the new card twice?

I just tested this and it only adds one card for me. Double-check to 
make sure you've given us the entire recipe. As written above, it seems 
to work here.

BTW, a command handler ("on addCard") is probably a more natural way to 
write this behavior, since functions generally return a value and this 
one doesn't do that.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list