Help! What is wrong with my syntax in using the filter command in these two instances?
filter VarOne with VarTwo
VarOne is a variable containing lines of tab-delimited text, including some lines that contain the string that's stored in the VarTwo variable? After the command above VarOne is always empty even though, seems to me, it shouldn't be.
filter field "test field" with varTwo
Same result. field 'test field" contains the same data as in the first attempt to use filter above. The command filters field "test field" to empty even though the string in varTwo most definitely occurs on some of the lines.
What is wrong? I've written some scripts in which the filter command works as intended, but in many other instances I've had to resort to running through the data line by line and deleting any lines that don't contain the intended string. A less elegant approach; at least I can get it to work. Any suggestions?
Thanks in advance,
Sieg
filter command syntax
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 29
- Joined: Mon Apr 09, 2012 8:53 pm
Re: filter command syntax
Hi Sieg,
Make sure you have wildcards in place
varTwo shold look like
*linetoFind*
Simon
Make sure you have wildcards in place
varTwo shold look like
*linetoFind*
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- VIP Livecode Opensource Backer
- Posts: 29
- Joined: Mon Apr 09, 2012 8:53 pm
Re: filter command syntax
Thanks, Simon.
Now I get it.
Have to say it's a bit hard to conceptualize what the LiveCode Dictionary's explanation of the * wildcard means ("Matches zero or more of any character") when the * wildcards bracket the string.
Sieg
Now I get it.
Have to say it's a bit hard to conceptualize what the LiveCode Dictionary's explanation of the * wildcard means ("Matches zero or more of any character") when the * wildcards bracket the string.
Sieg