Comma delimiter...
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Comma delimiter...
Been trying to match a number in a string
but don't think that the comma delimiter works
the way it should.
Will match 1 with anything with a 1 in it eg 11.
The only way I can get it to work is to insert
a leading comma and search for ",1,".
Not the way I expected and a lot of typing.
Suggestions welcome. Stack is here...
New version http://www.wikifortio.com/455707/comma1a.zip
http://www.wikifortio.com/596057/comma1.zip
but don't think that the comma delimiter works
the way it should.
Will match 1 with anything with a 1 in it eg 11.
The only way I can get it to work is to insert
a leading comma and search for ",1,".
Not the way I expected and a lot of typing.
Suggestions welcome. Stack is here...
New version http://www.wikifortio.com/455707/comma1a.zip
http://www.wikifortio.com/596057/comma1.zip
Last edited by bjb007 on Sun Feb 17, 2008 1:04 am, edited 1 time in total.
You use "is (not) within" which will be true for any occurrence, even in words, sentences or items. If you just want to have an item, use "is (not) among the items of".
To do anything at all, there's most often very different ways to achieve something. If you just say "doesn't work in rev", because you haven't yet found the correct term, people will be less inclined to help you.
Also people will be unable to help without a proper and short example. So why didn't you just post the code, it's a single command, and in this case a single line of code would be sufficient to show your problem.
To do anything at all, there's most often very different ways to achieve something. If you just say "doesn't work in rev", because you haven't yet found the correct term, people will be less inclined to help you.
Also people will be unable to help without a proper and short example. So why didn't you just post the code, it's a single command, and in this case a single line of code would be sufficient to show your problem.
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Comma delimiter...
BvG
The stack is on wikifortio - link in last post.
I used "is in" which is shown in the docs.
What I'm saying is that it doesn't work in the
way I expected i.e. if the comma is the delimiter
I expect the prog. to compare with what appears
between two commas and not with ",1".
In the stack example I've put in extra commas but
if they're taken out it doesn't work.
So to me this is a malfunction.
The stack is on wikifortio - link in last post.
I used "is in" which is shown in the docs.
What I'm saying is that it doesn't work in the
way I expected i.e. if the comma is the delimiter
I expect the prog. to compare with what appears
between two commas and not with ",1".
In the stack example I've put in extra commas but
if they're taken out it doesn't work.
So to me this is a malfunction.
You didn't even read my text. Rev has many ways to do things the same, or very similar to each other. You want is among. Please look it up in the dictionary.
The is in comparision will return true if the string you specify is within another string. It doesn't care for commas, unlike the is among command, which you want to use. Please do not use is in to determine the existence of items or words or lines. Use is among instead.
The is in comparision will return true if the string you specify is within another string. It doesn't care for commas, unlike the is among command, which you want to use. Please do not use is in to determine the existence of items or words or lines. Use is among instead.
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Comma delimiter
BvG
Ok I understand now. I was looking more at
the "comma delimiter" side of it - and assuming
that the comma delimited the items in the list.
Which it clearly doesn't in this case.
Ok I understand now. I was looking more at
the "comma delimiter" side of it - and assuming
that the comma delimited the items in the list.
Which it clearly doesn't in this case.
Life is just a bowl of cherries.
-
- Posts: 179
- Joined: Sat Apr 08, 2006 11:08 pm
- Contact:
Re: Comma delimiter
When you use "is in" you aren't telling the engine to look at the list as comma delimited items. So it looks at a string that happens to have some commas in it. It then looks for a match for the 'search' string.bjb007 wrote:BvG
Ok I understand now. I was looking more at
the "comma delimiter" side of it - and assuming
that the comma delimited the items in the list.
Which it clearly doesn't in this case.
When you use "is among the items of", as bvg suggests, you are telling the engine that it's looking at a list of items, delimited (by default) by commas. Then it looks for a match of your search string 'among' the items.
In other words, it's only a comma delimited list if you tell the engine to look at it as such by using the appropriate vocabulary : "among the items of".
Best,
Mark