Page 1 of 1
First try with "Filter"
Posted: Sat Sep 06, 2008 4:35 pm
by bjb007
Haven't had any luck trying to do
filter vFour with vOne
Is it possible?
The error messages aren't any help.
Posted: Sun Sep 07, 2008 10:46 am
by Janschenkel
Well it's hard to judge the cause if all we have is a one-liner...
Is the Script Editor throwing an error during compilation? Is the result less than satisfactory?
What exactly are vFour and vOne?
Local variables? Global variables?
And what is in them?
The filter command allows you to 'filter' the lines of a 'container' on the basis of a filter pattern, which is a very limited version of regular expression syntax.
So what exactly is confusing or not working?
I'm sure we can help figure it out.
Jan Schenkel.
First try with "Filter"
Posted: Sun Sep 07, 2008 2:34 pm
by bjb007
The question was general.
Can a variable be filtered by another variable?
Assume that the contents of the variable are
suitable e.g.
vFour = 123
vOne = 1
Posted: Sun Sep 07, 2008 7:17 pm
by BvG
That will work, but result in an empty var. Filter does look at each line, and if the line doesn't match the simplified regular expression you gave it, it will remove that line from the var. If you give it "1", it'll expect exactly that as a line, so "123" will not qualify.
A better example might be:
vFour = 1 & return & 2 & return & 3
vOne = 1
filter vFour with vOne = 1
filter vFour without vOne = 2 & return & 3
First try with "Filter"
Posted: Sun Sep 07, 2008 10:52 pm
by bjb007
Thanks BvG.
There's a stack in my User Space
called "Filter" which shows how to
use the filter function.