There are many ways to be different - there is only one way to be yourself - be amazing at it
The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
Mor3bane wrote:The way it is coded now gives the correct "connected" result, however the "offline" result is "-Connected".
Because according to the first part of the Substitute option, 1 is always substituted by Connected, even if it has a minus before.
To fix it, add to the [MeasureConnectivity] measure a RegExpSubstitute=1 option and add the ^ and $ around the 1, in the Substitute:
^ represents the beginning of the expression, while $ represents the end of it. So, the "^1$":"Connected" will be applied only if the entire expression is 1 (no more, no less), and "^-1$":"Off Line" will be applied when the whole expression is -1. Usually the Substitute option don't use these regular expressions, to do that, you need the RegExpSubstitute=1 option: https://docs.rainmeter.net/manual/measures/general-options/substitute/#RegExpSubstitute
There are many ways to be different - there is only one way to be yourself - be amazing at it
The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
One more: what you wanted can be done even without using the regular expressions, just have to be careful to the order of substitutions. Make sure that when the first substitution is made, the second won't be:
In this case, if the value of the measure is -1, it'll be substituted by Off Line and because Off Line don't contain the character 1, the second substitution is not applied, so you'll get Off Line. If on the other hand, the value returned by the measure is 1, the first substitution is ignored, because the value of the measure don't contain -1. In this case, the second substitution will be applied, so the measure will return Connected.
In this case you don't need the RegExpSubstitute=1 option.
balala wrote:One more: what you wanted can be done even without using the regular expressions, just have to be careful to the order of substitutions. Make sure that when the first substitution is made, the second won't be:
In this case, if the value of the measure is -1, it'll be substituted by Off Line and because Off Line don't contain the character 1, the second substitution is not applied, so you'll get Off Line. If on the other hand, the value returned by the measure is 1, the first substitution is ignored, because the value of the measure don't contain -1. In this case, the second substitution will be applied, so the measure will return Connected.
In this case you don't need the RegExpSubstitute=1 option.
That's cool! It works on the "fall through" principle which is very common in higher language programming. Given that I know that just means I get experience another "why didn't I remember that" moment
There are many ways to be different - there is only one way to be yourself - be amazing at it
The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
The key is to remember that Substitute works on each comma-separated "segment" of the Substitute option in order, and with the action of later segments operating on the results of earlier...