Line offset of an item (and other similar functions).

Alex Tweedly alex at tweedly.net
Tue Jan 25 04:57:54 CST 2005


Sarah Reichelt wrote:

>> I do want to match only whole items, so as to avoid false positives 
>> (i.e. item "alex1" should not match "alex123")
>>
>> lineOffset will give me the line number - but there's no way to say 
>> "match whole items only"
>> itemOffset will find the right instance (given wholeMatches set to 
>> true), but it gives me item number, not line number
>> matchChunk will find it for me - but gives character positions, not 
>> line number
>>
>> I'm hoping there's some way to inveigle one of the 'offset' functions 
>> to do this.
>
> The docs say wholeMatches works with lineOffset, so if it doesn't, you 
> should bugzilla that as either a bug or a docs error.

wholeMatches does just what it says it will - match only if the string 
matches the whole line.
I'm looking for a way to match whole items - but get line numbers as a 
result. Jacqueline gave me the perfect way, using
   get the number of lines in item 1 to itemOffset(tString, tData) in tData

-- Alex.


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.3 - Release Date: 24/01/2005



More information about the use-livecode mailing list