Can't seem to print the script of a card

Len Morgan len-morgan at crcom.net
Sat Jan 16 22:02:26 EST 2010


On 1/16/2010 8:51 PM, Sarah Reichelt wrote:
> On Sun, Jan 17, 2010 at 12:39 PM, Len Morgan<len-morgan at crcom.net>  wrote:
>    
>> I'm trying to write a recursive stack printer and I'm having trouble with
>> "unnamed" cards (i.e., cards that have the default name of "card id 1002").
>>
>> I use the following:
>>
>> on printCards pStack
>>     put the cardNames of stack pStack into theCards
>>
>>     repeat for each line c of theCards
>>         put the script of card c of stack pStack into theScript
>>         ...
>>     end repeat
>> end printCards
>>
>> I get an error saying "Can't find card"  every time I hit a card that has
>> never been named.  Is this not possible or am I doing something wrong?
>>      
> The problem is that the default description for an un-named card
> includes the word "card".
> So you are effectively telling the script to print "card card id
> 1002", which does not exist.
>
> You might be better using the cardIDs instead of the cardNames to
> populate the original list.
>
> Cheers,
> Sarah
>    

Thanks Sarah, that worked perfectly.

len



More information about the use-livecode mailing list