Page 1 of 1
Comma delimiter...
Posted: Sat Feb 16, 2008 9:51 pm
by bjb007
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
Posted: Sat Feb 16, 2008 11:25 pm
by BvG
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.
Comma delimiter...
Posted: Sun Feb 17, 2008 12:03 am
by bjb007
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.
Posted: Sun Feb 17, 2008 1:28 am
by BvG
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.
Comma delimiter
Posted: Sun Feb 17, 2008 4:40 am
by bjb007
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.
Re: Comma delimiter
Posted: Tue Feb 19, 2008 5:39 pm
by Mark Smith
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 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.
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