Page 1 of 1

Evaluate second line in text

Posted: 18 Nov 2019 00:27
by Lucy
Hi.
I have a notification that displays its content in 3 separate lines.
The content on the second line is all i want automagic to concentrate on. It is a numeric only line and i was hoping for some help on...
Having automagic determine if the number is greater than, lesser than, etc.
I know the operators "<>=" and so forth. My issue is that i have no idea how to evaluate ONLY the second line.

Re: Evaluate second line in text

Posted: 18 Nov 2019 21:01
by Horschte
Try to split the notification to get the second line:

Code: Select all

lines = split(notification_text, "\\n");
target_line = lines[1];

Re: Evaluate second line in text

Posted: 19 Nov 2019 04:15
by Lucy
Thanks sweetie.. I'll have a go

Re: Evaluate second line in text

Posted: 19 Nov 2019 08:22
by Lucy
Ok i had a go at it but i used a text file to test.
It errors for me and have no idea how to fix it.
This is my script...


lines = split({file_text}, "\\n");
target_line = lines[1];
if (target_line >=20)
{
global_update_mod = "true";
}
else
{
global_update_mod = "false";
}

What am i doing wrong?

Re: Evaluate second line in text

Posted: 19 Nov 2019 15:17
by Horschte
Add a Debug Dialog and have a look at "target_line". What's its value?

Re: Evaluate second line in text

Posted: 19 Nov 2019 23:48
by Lucy
😂 thanks... debug showed i had the wrong kine. Ok now i have intercepted the line i want... i am stuck once more.
By using several ">" on different value types does not work. It ignores all except the lowest value. Meaning if i have it for...
>30
>20
>10
And i ask it to determine >30 it will just accept the >10 because it is more than 10.
How can i write it so that it is "more than but less than"?
I tried a simple >30<40 but that did not work. Whats the correct way to write it please?

Re: Evaluate second line in text

Posted: 20 Nov 2019 02:27
by Lucy
Ugh... it simply cant handle several of those statements at a time. And just gives me a null for high numbers like 30. It works ok if i just use a couple

Re: Evaluate second line in text

Posted: 20 Nov 2019 18:10
by Horschte
How can i write it so that it is "more than but less than"?
I tried a simple >30<40 but that did not work. Whats the correct way to write it please?

Code: Select all

if(v > 30 and v < 40){
  //do something
}

Re: Evaluate second line in text

Posted: 20 Nov 2019 18:40
by Lucy
Lol everything is so simple and straightforward but it eludes me because i always look at it as difficult 😂🤦‍♀️
Thanks.. I'll play around with it

Re: Evaluate second line in text

Posted: 20 Nov 2019 20:06
by Lucy
Ooooh... that seems to be working, thank you. After sufficient data is logged for it to trigger i will have properly tested it then