Change to how characters other than a-z A-Z 0-9 are handled in measure names.
It has come up that having a character other than the standard English alphanumeric characters at the beginning of a measure name can cause errors when those measure names are used in IfCondition tests and the Formula option in a Calc measure.
Those are cases where the measure name is NOT used as a [SectionVariable] which has always worked fine, and still does. It is when the measure name is used in those two cases of a "formula", where they are used without the [brackets].
This doesn't work but should..
That currently causes errors in both the Formula and IfCondition options on the Calc measure.
Code: Select all
[Rainmeter] Update=1000 DynamicWindowSize=1 AccurateText=1 [Variables] [@MyMeasure] Measure=String String=50 MinValue=0 MaxValue=100 [MeasureLogIt] Measure=Calc Formula=@MyMeasure IfCondition=@MyMeasure <= 19 IfTrueAction=[!Log "Value is less than 19"] IfCondition2=(@MyMeasure > 19) && (@MyMeasure < 23) IfTrueAction2=[!Log "Value is between 20 and 22"] IfCondition3=@MyMeasure >= 23 IfTrueAction3=[!Log "Value is greater than 22"] [MeterDisplay] Meter=String MeasureName=@MyMeasure FontSize=15 FontWeight=400 FontColor=255,255,255,255 SolidColor=47,47,47,255 Padding=5,5,5,5 AntiAlias=1
This does work...
The root of this is in the "math parser" that is a part of Rainmeter. The issue is that the math parser recognizes all the math "symbols' that are used in formulas, and recognizes the "letters" alphanumeric characters a-z A-Z 0-9, but treats all other characters as "unknown", and this can, in some cases, cause an error.
Code: Select all
[Rainmeter] Update=1000 DynamicWindowSize=1 AccurateText=1 [Variables] [MyMeasure] Measure=String String=50 MinValue=0 MaxValue=100 [MeasureLogIt] Measure=Calc Formula=MyMeasure IfCondition=MyMeasure <= 19 IfTrueAction=[!Log "Value is less than 19"] IfCondition2=(MyMeasure > 19) && (MyMeasure < 23) IfTrueAction2=[!Log "Value is between 20 and 22"] IfCondition3=MyMeasure >= 23 IfTrueAction3=[!Log "Value is greater than 22"] [MeterDisplay] Meter=String MeasureName=MyMeasure FontSize=15 FontWeight=400 FontColor=255,255,255,255 SolidColor=47,47,47,255 Padding=5,5,5,5 AntiAlias=1
Change: We have changed this so pretty much all characters that are NOT math "symbols" are treated as "letters", which we believe will solve this problem.
So the new "rule" for naming measures will now be:
- Measure names may start with or contain any "letter/number" characters or "punctuation", as long as they do NOT contain a character defined as a math symbol. Those math symbol characters are:
Never use those math symbols ANYWHERE in a measure name. It is a guaranteed error.
- Measures names probably should NOT contain the characters , which may cause general confusion with [SectionVariables] and #Variables#.
- Measure names may NOT start with any Unicode "symbol" or "emoji" characters, like or for instance. Only use "letter/word" characters, in any language. For instance , , , or are fine.
- Measures names may NOT start with any Unicode "space" characters, like , an EM SPACE in the Unicode set. Rainmeter will ignore and throw away any leading normal spaces, (and tabs) but will raise an error if those Unicode spaces are used.
- Measure names may NOT start with any ASCII "control" characters, those defined as being below "32" in the decimal ASCII character set.
So the long and the short of it is that measures names can start with or contain any printable letter, number or non-math punctuation or symbol from the ASCII / Extended ASCII character set, and any Unicode "letter/word" character from any language. Stay away from everything else...
This new "rule" really applies to all section names, but is only relevant with measures names, which can be used in IfCondition and Formula.
It is not my intention to actually document all of that, as it is kinda confusing (if not TLDR overwhelming) and I think the current general advice not to use other than normal alphanumeric characters is good enough, but that will be the new "technical rule".
It allows me to keep my [@CurrentTemperature] syntax for the @Include measures in my weather skin...
We want you guys to help us beat this up, to be sure there isn't bleed-over effect that causes problems when non-alphanumeric or Unicode characters are used in measure names or variable names, and then used in (formulas) in various places. Again, this change should only impact "math related" functionality.