Probably a silly question about 'find'

Devin Asay devin_asay at byu.edu
Thu Jan 18 10:48:48 EST 2007


On Jan 18, 2007, at 2:32 AM, Peter Alcibiades wrote:

> Feels like a very silly question, but it is stumping me.
>
> How do I use 'find' to find '4' when it occurs by itself but not 4  
> when it
> occurs in '4.1', when searching the contents of a field?
>
> I have a field with tab separated values in the form
>
> 1	1234
> 2	2.56
> 3	4.1
> 4	9.274
>
> and I want to find only that line in which there is a match of the  
> inputted
> string with the first item.  The first item will always be a unique  
> value.
> So I want in some way to do a find on 4 that will pick up only line  
> 4, and
> not the occurrence of 4 in line 3.
>
> Find word doesn't seem to work, because presumably Rev sees the '.'  
> as a word
> limiter.  Whereas in fact, its a decimal....  Find string in item 1  
> doesn't
> work either.   In fact, none of the parameters on find seem to work.

Peter,

Find is probably not the best choice in this case. I would use the  
lineOffset function and look for 4 & tab, like this:

put lineOffset(4 & tab,fld "thevalues") into tLineFound

HTH

Devin

Devin Asay
Humanities Technology and Research Support Center
Brigham Young University




More information about the use-livecode mailing list