Finding

Richard D. Miller wow at together.net
Sat Jan 5 23:56:02 EST 2002


Bill:
> 
> "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.
I'd like to know more about the Transcript Dictionary search function.

> 
> Alternatively, you could do a:
> find return & "k" in field xxx -- the "k" could be a variable for the
> letter you want.
Essentially, that's what I've ended up doing so far, except I'm using the
lineoffset function in a loop, having it look for the return character + the
first character of the line(s) I'm searching for. It's working well enough.
> 
> 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.
I looked at that command. I actually need the line numbers...not the lines
themselves. The line numbers serve as indexes to additional data.

Richard
> 
>> 
>> 
>> Richard
>> 
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> _______________________________________________
> 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