Currently, the warnif plugin takes in a value, AAA, compares it with value BBB. If the comparison is true, returns warning WWW, and if it is false, it returns the input value AAA.
Limbo, or anyone else, could you make a plugin, ie warnif2, that has the same function as warnif, but instead of returning the input value on a false comparison, return a second warning value XXX?
Example: $dll(warnif2.dll,1,5/1,Greater Than/Less Than) would return "Greater Than"
Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases
Warnif modification/adaptation. Limbo?
Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo
-
- Posts: 4
- Joined: July 17th, 2007, 10:31 pm
- Location: Atlanta, GA
-
- Plugin Author
- Posts: 1604
- Joined: February 13th, 2005, 7:38 pm
- Location: Athens - Greece
- Contact:
-
- Forum Supporter
- Posts: 734
- Joined: October 15th, 2005, 10:39 am
- Location: Romania
- Contact:
-
- Plugin Author
- Posts: 1604
- Joined: February 13th, 2005, 7:38 pm
- Location: Athens - Greece
- Contact:
Actually the problem is that warnif returns the first parameter passed when the comparision is false (when I coded I have in mind a server on the computer room with a remote LCD). This is helpful when you need to display the checked value in normal condition and an alert signal when the value exceeds a limit.
Let's say that you want to check the temprature of the system and display a message when the value exceeds the 70 degrees:
The above statement will display the actual temprature until it reaches 71 degrees then the CPU BURNING message will appear.
There is no way, at least a simple one, to display two messages one for normal and one for alarm state. The only way is to try nested calls of the same plugin.

Let's say that you want to check the temprature of the system and display a message when the value exceeds the 70 degrees:
Code: Select all
$dll(warnif.dll,1,$Temp1/70,CPU BURNING)
There is no way, at least a simple one, to display two messages one for normal and one for alarm state. The only way is to try nested calls of the same plugin.