Why doesn't menupick work

Devin Asay devinasay at gmail.com
Thu Aug 21 07:40:06 EDT 2014


On Aug 21, 2014, at 5:02 AM, revolution at duncansoftware.on-rev.com wrote:

> On 8/20/2014, 8:08 PM, revolution at duncansoftware.on-rev.com wrote:
>> Why doesn't  this code work?
>> 
>> on menuPick pItemName
>>   go card pItemName
>> end menuPick
>> 
>> where the comboBox has a list of card names.
> 
>>> Set a breakpoint at the "go" line and when it pauses, see what's in 
>>> pItemName and whether there's a card with that name. You can also 
>>> temporarily add "answer the result" after the "go" statement; maybe 
>>> there's a silent error happening.
> 
> Thanks for everyone's suggestions but...
> I tried setting a breakpoint and pItemName contains the name of a card. 
> However when I tried "answer the result" the response is
> "No such card".
> When I use the message box "Put the name of card 1" it reports
> card " 1 External  Dorsal ~"
> which seems to be saying that "card" is part of the name.
> I tried various methods of adding card to the pItemName such as
> put "card" && quote & pItemName & quote into pitemName
> 
> go pItemName
> 
> or 
> 
> go card card pItemName
> 
> but these also failed and reported "No such card."
> 
> The spaces and tilde in the card name is not the problem.
> There are 75+ cards and many do not have extra spaces and tildes.
> 
> If I just type into the message box
> go card " 1 External  Dorsal ~" it goes to the card.

Two things to check:

1. In your last code example there is a space at the beginning of the card name. Is that accurate? Is the space actually in the name of the card, and if so, is the space included in the list of names in the combo box?

2. Use 'the short name' property to get just the name of the card (or whatever object you’re referring to), without getting the object type information.

HTH

Devin

Devin Asay
Learn to code with LiveCode University
http://university.livecode.com





More information about the use-livecode mailing list