Evaluate second line in text
Moderator: Martin
Evaluate second line in text
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.
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
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
Thanks sweetie.. I'll have a go
Re: Evaluate second line in text
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?
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
Add a Debug Dialog and have a look at "target_line". What's its value?
Re: Evaluate second line in text
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?
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
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
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
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
Thanks.. I'll play around with it
Re: Evaluate second line in text
Ooooh... that seems to be working, thank you. After sufficient data is logged for it to trigger i will have properly tested it then