Newbie3

dunbarx dunbarx at aol.com
Mon Dec 8 09:54:22 EST 2008


Feels like old times. When I get to newbie4000 I can start helping out around here.

So, fullFind...

What I like about this gadget is its ability to return ALL matched instances by line, item or character.  It returns chunk-based information about the location(s) of a string within a container. Even HC's old "search" XFCN from the power tools stack could do that.

I wrote a few workarounds using the lineOffset function. They all do the job just fine in their own way, and I can implement one of them as a function and keep it in a library (a stack in use?). I am sure the other offSet functions will come in handy. I see there is already a native substitute for "fullReplace". Well and good.

But  I can write a substitute for fullFind in hypertalk, too. The lineOffset function only returns the first instance, so additional processing is required to get all of them. So, wow me with Rev's arsenal. How to do it without a repeat loop? Find all "ab" in:

abc
def
abc

I want "1,3" back at me, or somesuch.

Jacqueline, I finally got the "filter" command to work, but this simply extracts data; I lose the chunk positional information present in the original text. How would one use it to emulate fullFind?

Grudgingly learning to like Revolution. (Sob) My belligerent stance derives only from loyalty.

Oh yes, thanks to anyone who takes the trouble...

Craig Newman


On Dec 5, 2008, at 1:12:17 PM, "J. Landman Gay" <jacque at hyperactivesw.com> wrote:
FullFind can be replaced with the "filter" command, or by using any one
of the various offset functions. If you choose to use offset, be sure to
use the "skip" parameter or else you will be searching the same text
repeatedly.




More information about the use-livecode mailing list