How to find the name of the recent card?
David Bovill
david at viral.academy
Sat Jul 2 12:40:39 EDT 2016
Yes this is the best solution I think.
I still miss not having the information at engine level to cover cases in
which you may arrive form a number of stacks - and you don't not want to
use a library, nor have to worry about inadvertent blocking of closecard
messages.
On 2 July 2016 at 17:33, Mike Bonner <bonnmike at gmail.com> wrote:
> Closecard works pretty well for the "store the card just exited"
> workaround.
>
> ## stack script
> local sLastCard
> on closecard
> put the id of the target into sLastCard
> end closecard
>
> function getLastCd
> return sLastCard
> end getLastCd
>
> on preopencard
> put getLastCd() -- grabs the value stored by closecard
> put cr & the id of the current card after msg
> end preopencard
>
>
>
>
> On Sat, Jul 2, 2016 at 10:00 AM, Mark Wieder <mwieder at ahsoftware.net>
> wrote:
>
> > On 07/02/2016 08:41 AM, David Bovill wrote:
> >
> > Within the preOpenStack handler we haven't yet arrived - so the recent
> card
> >> should be as it is the recent card before actual going anywhere. But
> then
> >> the currentcard should not be already updated to return the value of the
> >> card you have not actually arrived at - the current card should return
> the
> >> value of the card you left.
> >>
> >
> > Current card *has to* be updated. Otherwise when you are performing
> > actions in the preOpenCard handler you would be changing the card you
> just
> > came from.
> >
> > unfortunately the target returns the same as the current card - so we
> still
> >> have this informational hole in the middle where we cannot tell the
> value
> >> of the card we left before arriving so to speak - we get the one before
> >> and
> >> the one we will arrive to - but not the one we left.
> >>
> >
> > Hmmm.
> > I suppose a workaround would be to store the id of the current card
> before
> > going to the new card, and then on preOpenCard using the stored id value
> to
> > reference the starting card.
> >
> > --
> > Mark Wieder
> > ahsoftware at gmail.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
> >
> _______________________________________________
> 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