Hi Horst,
Upon revisiting this problem, things do seem to act strange:
- I created a new mainstack "mainie"
- I added two substacks "subbie1" and "subbie2"
- I went back to the mainstack and added a button
Code: Select all
on mouseUp
-- first display the current situation for later reference
answer the recentCards
-- next go to the first substack without locking recent
open stack "subbie1"
-- now the first line of the recentCards should point to card 1 of subbie1
answer the recentCards
-- next go to the second substack while locking recent
lock recent
open stack "subbie2"
unlock recent
-- the first line of the recentCards should still point to card 1 of subbie1
answer the recentCards
end mouseUp
When I clicked the button, everything ran as I had expected.
However, when I added a button to subbie2 to display the recentCards again, it did show a reference to card 1 of subbie2.
So I went back to the mainstack, dropped in a field, and chanegd the button script to
Code: Select all
on mouseUp
put the long ID of field 1 of the owner of me into tFieldRef
do "put empty into" && tFieldRef
do "put the recentCards & return & " & quote & "--" & quote & " & return before " & tFieldRef
open stack "subbie1"
do "put the recentCards & return & " & quote & "--" & quote & " & return before " & tFieldRef
lock recent
open stack "subbie2"
unlock recent
do "put the recentCards & return & " & quote & "--" & quote & " & return before " & tFieldRef
open stack "mainie"
do "put the recentCards & return & " & quote & "--" & quote & " & return before " & tFieldRef
end mouseUp
In that scenario, there was no reference to subbie2 after I had returned to the mainstack. This would suggest that:
- as long as your handler is running, the lockRecent is respected
- if you end on a card that can be added to the recentCards, there's no problem
- if you end on a card that you don't want added to the recentCards, it will be added as soon as you leave this card (e.g. by using an 'answer' dialog or by clicking in another window)
In conclusion, if you don't want a certain card to be added to the recentCards, lock recent before you go there, and don't end your navigation on that card.
Hope this clariefied things a bit,
Jan Schenkel.