How to find the name of the recent card?

Mike Bonner bonnmike at gmail.com
Sat Jul 2 12:33:06 EDT 2016


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
>



More information about the use-livecode mailing list