request for script or stack

Timothy Miller gandalf at doctorTimothyMiller.com
Fri Jul 29 14:14:00 EDT 2005


Reply from Sarah:

>>
>>If I could wish for one enhancement, the script would scroll a 
>>scrolling background so I could see the hit if it were otherwise 
>>scrolled out of sight. I'm not asking you to script that for me. Is 
>>it scriptable? If so, could you drop me a hint?
>After the find command has done, check "the foundChunk" and see what 
>it gives you. You could select it, which would automatically set the 
>scroll. Or you could work out which line it is and set the vScroll 
>of the field, but that might be tricky if the text is wrapping.


Thanks. Getting the foundchunk could be useful for other purposes, 
too. I tried putting "answer the foundchunk" in various points in 
your script. Nothing happened. I think I need to put it in the script 
of the card of the single-line message box, or something like that. 
Any ideas? If I fine tune this script a bit, I'll share it with the 
group, if anyone's interested.

I think the script has one small problem. It looks like it repeats 
endlessly. The messages don't appear in the message watcher because a 
button passing a message back to itself isn't a system message, 
AFAIK. (I put it in a bg btn.) It doesn't seem to bog the CPU down, 
so normally it wouldn't matter. But at one point, I wanted to cut the 
button and paste it somewhere else. Every time I tried to cut the 
button, Rev spontaneously quit. I finally opened the script, 
commented it out, closed the script, and then cut the button. Then, 
there was no problem. (I guess suspend messages would have worked, 
too.) So, I think it needs a few lines that will stop the script when 
the search is done.

>
>>
>>Regarding the find and replace window, it sounds like yours works a 
>>zillion times faster than mine. Any ideas about why that could be? 
>>My computer isn't a screamer. It's a 466 mhz G4.
>Mine's a 700 MHz G4, so it shouldn't be vastly different. And you 
>have more RAM than me, so that isn't it either. Sorry, I'm stumped. 
>The only suggestion I have is to make sure you are limiting your 
>searches to a specific stack and only one one aspect e.g. fields or 
>scripts. Do you have any of the check boxes on the left checked? I 
>never use them and I guess turning on "Case sensitive" could slow 
>things down.


Yeah, I'm talking about a moderately big stack, but not huge. It's 
2.5 MB. At least half of that is text in fields, often just a first 
and last name in a large number of fields, spread out over a large 
number of pages. (It's a daily schedule.) As I said, If I search for 
"Gloria" with the find-in-the-message box, I can get all eight hits 
in 92 ticks.

If I use the find-and-replace window, searching for field text only, 
in "this stack only" "Obey dontsearch property" turned on it takes 
110 seconds.

I exaggerated before. It's only 71.739 times slower, on a simple find 
text in field.

Yet on large sorts, in this stack and others, Rev is about as fast as 
hyperCard used to be, which seemed pretty darned fast, so the problem 
is not my machine or some problem with my OS or something.


>
>Checking through the Find script used by Rev, it uses either a 
>matchText function (if you selected RegEx) or a simple "if myString 
>is in ..." to find stuff. However it also uses a technique that I 
>hadn't come across before but looks very useful:
>     set allowInterrupts to false  -- this stops people interrupting 
>the script whenever they like
>     periodically, check "the interrupt" which tells you if someone 
>has tried to interrupt the script. This allows you to handle 
>interruptions gracefully and only when you want to.
>
>However, the Find script checks this once for each object that it 
>searches so it seems really weird if it is taking 10 - 15 seconds 
>per object.
>
>Sorry not to be more helpful,

You've been very helpful.

I want to make sure we understand each other. I'm complaining that 
the "find-and-replace" window is very slow. The "find" command, 
whether typed into the one-line message box or scripted, is plenty 
fast.

This is frustrating because the "find-and-replace" window could be 
endlessly useful, if it weren't uselessly slow. I'm in 2.6.1 now.

If we do understand each other, here's my need-to-know question:

***Is my experience with the find-and-replace window unusual?***

I'm a bit perplexed because I think I remember Jacque warning me that 
the "find-and-replace" feature is hopelessly slow, except maybe on a 
dual G5 or something. We were in 2.5.1 at the time.


Best regards,



Tim



More information about the use-livecode mailing list