Multiple String Values in IF - THEN - ELSE statement

(imported topic written by Matt.Johnson)

I have a custom property that is using the IF/THEN/ELSE statement. However, for one of the values I want it to look for 2 specific strings in the text document to qualify the response. For example:

IF exist lines whose (it as lowercase contains “Fully” as lowercase) of it AND exist lines whose (it as lowercase contains “Off” as lowercase) of it THEN “Suspended” ELSE …

It’s basically reading a text file that would have the word Fully on one line and Off on another. I want it to see both of these in the file, or move on

However, right now it errors when I try that.

Any help is appreciated!

(imported comment written by dmoore21)

try something like this

exists file “/your/file/location” whose (exists line whose (it contains “Fully”) AND (it contains “Off”) of it)

(imported comment written by Matt.Johnson)

Dmoore - Thanks for the reply - Sad to say it failed:

E: The operator “line” is not defined.

(imported comment written by dmoore21)

For now, you can try this (it does work in the Fixlet debugger):

exists line whose (it contains “Fully”) of file “C:\test.txt” AND exists line whose (it contains “Off”) of file “C:\test.txt”

When I get in tomorrow morning, I’ll re-arrange it so it’s a little more elegant.

(imported comment written by IanR2974)

Hi

i may of misunderstood your requirements, but if you want to have a multiple IF THEN ELSE statement, here is what i would have:

IF ((IF exist lines whose (it as lowercase contains “Fully” as lowercase) of it AND exist lines whose (it as lowercase contains “Off” as lowercase) of it THEN “Suspended” ELSE “False”) of file “C:\testfile”) THEN … ELSE…

point to note for IF THEN ELSE statements is the output of THEN and ELSE need to be other the same type i.e string or it will give you the E: Incompatible types. error

Hope this helps

Ian