Finding

Bill Vlahos bvlahos at jpl.nasa.gov
Sat Jan 5 23:25:01 EST 2002


"Richard D. Miller" wrote:

> Two search questions (I hope I've missed something in Rev...):
>
> 1. I've got a list field. It's sorted alphabetically. I want to scroll the
> list to the first line beginning with "k". I can't find any command that
> will identify that line. Normally, one would use lineoffset(). But it
> doesn't seem to work in Rev like it does in other programs. How can this be
> done?

I think you want the behavior of the Transcript Dictionary search function.
There is a way to look at that script but I can't remember it. I'm sure
someone else on this list will know how.

Alternatively, you could do a:
    find return & "k" in field xxx -- the "k" could be a variable for the
letter you want.

This will scroll the field to the selection but it will be centered vertically
(I don't know why this is the behavior) and will draw a box around the word.
This should be very fast.

>
>
> 2. I have a field with 500 lines, each line containing a number. How do I
> find all the lines which equal one particular value? Is there anything
> easier and faster than using something like the offset command in a loop?
>
> Of course, I could use externals for this. But I need this to work on Mac,
> Windows, and Unix.

Do you want to find the lines themselves or the line numbers? If you want to
display only the lines with the information you want the filter command. It is
very fast. This is also demonstrated with the previously mentioned Transcript
Dictionary search. Note that the filter command is "destructive" in that it
will eliminate the lines not containing what you are looking for. To get
around that simply put the entire contents into a variable so that you can
recover everything.

>
>
> Richard
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list