How to find the name of the recent card?

Mark Waddingham mark at livecode.com
Sat Jul 2 09:01:33 EDT 2016


On 2016-07-02 13:41, David Bovill wrote:
> Agreed - its' the inconsistency that is problematic. Also the inability 
> to
> establish where you have come from before rendering the contents of the
> display is a fundamental hole in the language - as we simply have no 
> access
> to the recent card here. Whether we get this by referring to the 
> current
> card in a preOpenStack handler (makes sense to me), or by using the 
> recent
> card is not so important - but we DO need to be able to know where we 
> have
> come from.

Is it an inconsistency? The 'recent' cards appear to be the list of 
cards that were visited before the current one - if openCard has not yet 
been reached then you could argue you haven't yet visited a new card. 
This appears to be by intent in the engine source after a quick look. 
(The recent card list is updated between preOpen and Open). The recent 
card list is also updated when window focus changes - so it can contain 
cards from any stack and will change as the user switches between 
windows.

What is your use-case in this scenario?

If you are wanting to know what card was 'come from' in a specific 
stack, then you could store that in a custom property of the stack at 
the end of OpenCard. Up until that point, the custom prop will have the 
previous card which is displayed.

Warmest Regards,

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list