offset broken?

Peter M. Brigham pmbrig at gmail.com
Sun Feb 23 18:41:15 CET 2014


It's easy to construct similar extensions of the other offset functions: lineoffsets(), itemoffsets() and wordoffsets(). They come in very handy. I do a lot of text munching and I am continually using one or another of them. One common situation is when you need not the first occurrence of a string in a container, but the last occurrence. Then just do: item -1 of offsets(str,tContainer). Or the line containing the last occurrence of str would be item -1 of lineoffsets(str,tContainer). Need to make every occurrence of a particular word appear in bold? It's easy using wordoffsets(). Etc, etc.

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig

On Feb 23, 2014, at 11:14 AM, J. Landman Gay wrote:

> Yours includes the method of finding whole words.  I left that out for brevity but it's a common thing to need.  So, not a waste.  
> 
> On February 23, 2014 6:18:28 AM CST, "Peter M. Brigham" <pmbrig at gmail.com> wrote:
>> Oh. Didn't see this before I sent off my version…
>> 
>> -- Peter
> 
> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list