A nasty experience with "the currentcard"
Geoff Canyon
gcanyon at gmail.com
Sat Feb 21 02:59:08 EST 2015
I don't remember -- it could just be that I was going for "current card"
and forgot the space. The script editor colors "currentcard" the same as
terms like long id, while it colors "current card" like keywords like
"stack"
For me, LC 6.7.1 on a Mac (most recent OS):
toplevel:
put the long id of the current card of the topstack -- works
put the long id of the currentcard of the topstack -- works
palette:
put the long id of the current card of the topstack -- works
put the long id of the currentcard of the topstack -- error:
button "Button": execution error at line n/a (Chunk: can't find card), char
1
And of course I was working on Navigator, stack name revNavigator, so no
error messages were thrown. It would be nice if there were a simple way to
change the name of a stack, and all the behaviors that reference buttons in
that stack.
On Sat, Feb 21, 2015 at 1:39 AM, Richard Gaskin <ambassador at fourthworld.com>
wrote:
> Geoff Canyon wrote:
>
> > It seems currentcard is undocumented. I don't even know where I
> > came up with it. But it works in general:
> >
> > put the long id of the currentcard of the topstack
> >
> > works fine in the message box. It also works in the script of
> > a button -- generally. As it turns out, the above will give an
> > error *if* the button is in a palette stack, but not if it's
> > in a toplevel stack. (at least in 6.7.1 on a mac) I can't really
> > call it a bug since "currentcard" isn't in the dictionary. But
> > it just cost me two hours of my life, so this my primitive
> > yawp of frustration.
>
> I didn't know about "currentCard" so I just tried it - made a two stacks,
> the first opens the second as a palette, and the second has the statement
> shown above in a button's mouseUp handler. Works as expected.
>
> Also works with "this card".
>
> LC 6.7.2, Ubuntu 14.04
>
> If "currentCard" is undocumented what prompted you to try it?
>
> Does it work with "this card"?
>
> --
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for Desktop, Mobile, and Web
> ____________________________________________________________
> Ambassador at FourthWorld.com http://www.FourthWorld.com
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list