If I get this message from nma as broadcast, how do i refer to it in condition expression? Since the number value will change from time to time
Its above threshold:
933
A question about expression
Moderator: Martin
Re: A question about expression
You can extract the number in the message in different ways and compare the value. Something like this should work in a condition Expression:
Code: Select all
//simulate nma message
m = "Its above threshold:\n933";
//find the index of the first colon
i = indexOf(m, ":");
//extract the value (position of the colon + 2 to skip the colon and the newline characters)
value = substring(m, i + 2);
//test whether or not the value is bigger than 900
//determines whether the condition is true/false since it is the last statement in the condition
val>900;
Re: A question about expression
Thanks, as I also initiate the message I found it was easier just to send the number