I think I found a oddity in the "currentCard" property.

The documentation states that the currentCard property return the short name of the current card of a stack:

for example: put the currentCard of stack "Untitled 1" into tCardName

You can then execute code such as: set the myProperty of cd tCardName of stack "Untitled 1" to tValue

However, if the card does not have a name set, then current card returns "card id <idnumber>", example: card id 1002 and the above 2 lines of code return a runtime error of 'can't find card'

put the currentCard of stack "Untitled 1" into tCardName
set the myProperty of cd tCardName of stack "Untitled 1" to tValue

WORKS for cards with a name
FAILS for cards without a name (where currentCard returns 'card id <number')

I think currentCard should just return 'id 1002' rather than 'card id 1002' if a card has no name.

Trying to execute: set the myProperty of cd tCardName of stack "Untitled 1" to tValue WHEN tCardName contain 'card id 1002' produces a run time error

But trying to execute: set the myProperty of cd id 1002 of stack "Untitled 1" to tValue works.

Oddly, set the myProperty of cd tCardName of stack "Untitled 1" to tValue FAILS if tCardName contains "id 10001" (and yes that card with that ID exists)

Oddly again, set the myProperty of the currentCard of stack "Untitled 1" to tValue DOES WORK whether they have a name or not

But again, breaking that example above (set the myProperty of the currentCard of stack "Untitled 1" to tValue) into 2 lines:
put the currentCard of stack "Untitled 1" into tCardName
set the myProperty of cd tCardName of stack "Untitled 1" to tValue
FAILS if the card has no name.

Something just seems off here?

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to