Probably a silly question about 'find'

Peter Alcibiades palcibiades-first at yahoo.co.uk
Thu Jan 18 04:32:56 EST 2007


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.

The only thing that has occurred to me is a real kludge - just stick some 
character like # in front of or after the numbers in the first position, and 
then search for #4, and hope that it never occurs to anyone to put this 
character into the second field!  But there must surely be a very simple and 
much better way?

Peter



More information about the use-livecode mailing list