how to exclude cards/stacks from recentcards?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
inselfan
Posts: 42
Joined: Fri Nov 10, 2006 11:33 am
Location: Menorca, Spain

how to exclude cards/stacks from recentcards?

Post by inselfan » Thu Mar 29, 2007 12:54 pm

Holá everybody,

Is there anybody, who knows, how to exclude (not put in) an opened stack/Card from recentcards?

I don't understandf (as usual) the docs

best regards and thank you

Horst

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Location: Aalst, Belgium
Contact:

Post by Janschenkel » Fri Mar 30, 2007 8:41 am

Hi Horst,

The only way to excluse cards from being added, is explicitly setting the global lockRecent property to true before going to the card. By default, this property is set to false, and it will automatically be reset to false when all running handlers are finished - so you can't set it once and forget about it.
There are two ways of doing this - both versions do the same thing, but it just goes to show how syntactically rich Revolution is and how it fits your programming style.

Code: Select all

lock recent
-- now go to the card
unlock recent

Code: Select all

set the lockRecent to true
-- now go to the card
set the lockRecent to false
Hope this helped,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

inselfan
Posts: 42
Joined: Fri Nov 10, 2006 11:33 am
Location: Menorca, Spain

Post by inselfan » Sat Mar 31, 2007 12:32 pm

Holá Jan,

Thanks for your answer. But, I'm sorry this does not work fine.

What I do is (by pressinbg a button):

On MouseUp
Global ## defining the Variables
put ... ## filling them with informations
lock recent
open stack "XYZ"
unlock recent
end MouseUp

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Location: Aalst, Belgium
Contact:

Post by Janschenkel » Mon Apr 02, 2007 12:08 pm

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.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

inselfan
Posts: 42
Joined: Fri Nov 10, 2006 11:33 am
Location: Menorca, Spain

Post by inselfan » Mon Apr 02, 2007 3:27 pm

Hi Jan,

Thanks for replying and your try to find a solution. But, I'm sorry the Result is the same than before :-(

But I think I found the reason.

Inside the button which calls another stack I use (have to) the
"open process" to call an external Program
If I disable this line, everything works fine.

The problem is now, that I have to open this programm which dials a given phone number. Any idea what to do?

best regards

Horst

Post Reply

Return to “Talking LiveCode”