Re: How to stay on a card when repeating a « find »

André.Bisseret Andre.Bisseret at inria.fr
Fri Feb 10 10:58:11 EST 2006


Le Thursday, 9 Feb 2006, à 21:12 Europe/Paris, J. Landman Gay a écrit :

> André.Bisseret wrote:
>> when it needs
>> to hilite words found on a card, it chooses randomly between two   
>> handlers that I named "Jim", and "JacqÉric" :-)o))
>> And, of course, for each one, it is totalizing the number of times it  
>>  was used and the time it took (In 4 fields of a substack).
>
> From a previous message:
>
>>>> Jacqueline, I like your tricky "dontsearch" solution. I tried it ;   
>>>> currently I have 320 cards and it works well and is very fast.
>>>> I am hesitating to use it because, at the end, after resetting the   
>>>> dontsearch of all cds to false, I must reset the dontsearch of   
>>>> certain cards to true ; well, anyway, the whole thing is running  
>>>> very  fast !
>
> There is another way to do this, if you will always have the same  
> cards searchable. Assume you always want to search three cards named  
> "card1", "card2", and "card3". You also want to search the current  
> card, whatever it may be.

Actually, it's the contrary : as a regular state, only few cards (the 4  
first ones in the stack) must remain non searchable ; while all the  
others must remain searchable.

So, the user write a small set of keywords ; I search all the cards  
(except 4) to find those where this set is present ; I display the list  
of this cards to the user ;  when the user click on one line of this  
list, I go to the corresponding card ; there I use the JacqÉric' script  
(or the Jim' one :-)) in order to find all occurrences of each keywords  
and highlight them on this current card.

In order to never search in the four first cards, I used the Éric' idea  
( using cardNames that allow to use the repeat for each form) :

put the cardNames of this stack into CardList
delete line 1 to 4 of CardList
repeat for each line tCd in CardList
set the dontSearch of tCd to true
end repeat
set the dontSearch of this cd to false --the only one that remains  
searchable
-- then I search keywords in this current cd, highlight them  
--and again on CardList, I set the dontSearch to false

Of course the race I quickly programmed is just for fun (I mean, the  
fact that my app. is currently (and temporarily)  choosing at random  
between Jim' and JacqÉric' solution).
In any case, my problem is solved ; the two scripts are very fast : for  
the user, the display of a card with the keywords highlighted is  
practically instantaneous ! (I set the cursor to watch, but, it is  
nearly to perceive it !!!), even though the two handlers are included  
in a quite larger one.
And I think that I am far from the moment when the number of cards in  
my app. will entail a noticeable delay !

Again a lot of thanks to you (and to Éric and Jim)

Best regards from Grenoble
André



> The first thing to do, during development, is run my original script  
> that sets all cards to "dontsearch". You only need to do that once.
>
> Then add scripts like this to your stack script:
>
> on preOpenCard
>  set the dontsearch of this cd to false
> end preOpencard
>
> on closeCard
>  if the short name of this cd is not among the items of \
>    "card1,card2,card3"
>  then set the dontsearch of this cd to true
> end closeCard
>
> This will automatically adjust the dontsearch of every card when it  
> opens and closes. The cards which are in your exceptions list will not  
> be changed; they will remain searchable.
>
> These scripts will be very fast and are not affected by how many cards  
> are in the stack.
>
> --  
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
------------------------------------------------------------------------ 
--------------------------
André Bisseret
Directeur de recherche émérite
Adresse : 140 rue E. Béthoux - 38220 Vizille
Tél. : 04 76 68 15 24
Courriel : Andre.Bisseret at inria.fr
            et : bisseret at andre-bisseret.com
site Multifiches :  
http://www-clips.imag.fr/multicom/partenariat/Multifiches/
site peinture : http://www.andre-bisseret.com/





More information about the use-livecode mailing list