Secrets of the filter command?

Jerry Daniels jerry at daniels-mara.com
Tue Jun 26 16:00:46 EDT 2007


David,

That filter is used to get the comments that are actually names of  
handler "folders" as well as the handler names in a script. We prefix  
the names of groups of handlers (handler folders) with "--> " at the  
beginning of a line outside a handler. Handler folders are optional  
in Galaxy.

So this use of the filter command would yield any lines in a script  
beginning with:

--> (comment used for handler folders)
on (command)
fun (function)
get (getProp)
set (setProp)

It also handles any irregularities with regard to upper/lower case.  
That part may actually be slowing it down, now that i think about it.  
But it is necessary when using the filter command in this fashion.

My feeling in using this approach was that the repeat loops within  
the binary engine of Revolution are faster then the repeat loops in a  
script which often involve text (non-binary) callbacks to the engine.  
That said, with the right repeat loop, I could be wrong, and, as I  
said, the upper/lower case stuff does make the filter slower.

One thing for sure, I have replaced many lines of code with one.

On Jun 26, 2007, at 1:58 PM, David Bovill wrote:

> I've always been curious about the filter command - and I am pretty  
> sure
> from examples I have seen that there is a lot more to it than is  
> shown in
> the docs.
>
> Take this example from Jerry Daniels beautiful Galaxy:
>
> filter someScript with "[-ofsgOFSG][-nueNUE][> ntNT]*"
>
>
> What is the leading "-" doing or the "> " ???
>
> Does anyone know what the underlying mechanism to it is - and are  
> there any
> links to a fuller documentation?
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the use-livecode mailing list