Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

ifinstring or if .. contains .. with boolean combination


  • Please log in to reply
2 replies to this topic
jovanni
  • Members
  • 7 posts
  • Last active: Aug 25 2010 05:56 PM
  • Joined: 13 Feb 2009
Hi,

my aim is to find a line of text which contains „<“ and „>“ and „/“ and probably some more characters.

So I tried

if (readline contains <) && (readline contains >)

(with different versions of quoting of < and >)

but it wont work, as far as I understood help file "&&" is similar to "AND" which is a boolean expression.

The single queries like

if (readline contains <)

work well.

After that I tried

ifinstring, readline, „<“

(with different versions of quoting of <)

this worked, but I’ve no (simple) idea how to integreate my boolean request to combine it with other characters like > and /. - I'm aware that it is possible to nest some if-queries in sequence, but thats not what I'm looking for - there should be a way to do it by using boolean combinations!



Who has an idea, how to query string-text with boolean combinations ?
Best regards

J. M.

jenn
  • Guests
  • Last active:
  • Joined: --

if (readline contains <) && (readline contains >)
(with different versions of quoting of < and >)

but it wont work, as far as I understood help file "&&" is similar to "AND" which is a boolean expression.

The operators "between", "is", "in", and "contains" are not supported in expressions.

That will not work. the if var contains are commands and cannot be used as (or in) expressions. However the equivalent function(s) can be used in expressiions. Like so:
if Instr(readline, "<") && InStr(readline. ">")


jovanni
  • Members
  • 7 posts
  • Last active: Aug 25 2010 05:56 PM
  • Joined: 13 Feb 2009
Hi,

inbetween I could find a solution (simultaneous with jenn), it works like

if ((instr(readline, „<“, false, 1))&& (instr(readline, „>“, false, 1))&& (instr(readline, „/“, false, 1)))
{


}
without any problem.

best regards

J.M.