This is a minor point, and there are ways around it, so I should just do one of those and move on, but it's frustrating me to tears because I just don't understand. And every seemingly relevant forum post I can find turns out to actually be a case of someone trying to do math in an IfMatch or use strings in an IfCondition, or something else that makes the answer tangential to what I'm looking for.
Code: Select all
[Variables] TestVariable=5 [DuckTest] Measure=Calc Formula=3 * #TestVariable# IfMatch=^15$ IfMatchAction=[!SetVariable duck "Joe"] IfNotMatchAction=[!SetVariable duck "Charlie"] [Ducky] Meter=String FontSize=24 FontColor=255,255,255 SolidColor=0,0,0 Text=The duck is named #duck#. DynamicVariables=1
Output: "The duck is named Charlie".
Variation 1: maybe the problem is that 15 is a number? That doesn't make much sense, since the measure has a string value; it just happens to be the symbols which represent its number value. Maybe IfMatch can handle an actual word?
Code: Select all
[DuckTest] Measure=Calc Formula=3 * #TestVariable# Substitute:"15":"Bob" IfMatch=^Bob$ IfMatchAction=[!SetVariable duck "Joe"] IfNotMatchAction=[!SetVariable duck "Charlie"]
Output: The duck is named Charlie.
Variation 2: um, okay, so maybe DuckTest isn't really outputting what I think it is? Let's see what it comes out to as a variable.
Code: Select all
[DuckTest] Measure=Calc Formula=3 * #TestVariable# Substitute:"15":"Bob" IfMatch=^Bob$ IfMatchAction=[!SetVariable duck "Joe"] IfNotMatchAction=[!SetVariable duck "[DuckTest]"]
Output: The duck is named Bob.
Wh...what? WHAT? "Does DuckTest match 'Bob'?" "No, it doesn't." "In your return-false message, what does DuckTest equal?" "'Bob'."
Note that these, to put it really mildly, are not the only variations I've tried, and I've gone through every permutation of syntax and structural logic as well: with the ^$ and without, with quotes around everything and around nothing, with #TestVariable# as a variable and as a separate measure, eliminating #TestVariable# and just putting a plain number in the Formula field... nothing names the stupid duck Joe.
What is happening? The closest I can come to an answer is that IfMatch can't access the string value of a Calc measure from inside it, which is to say that IfMatch, basically, cannot be used in a Calc measure unless you need something to return false on all conditions. If that's the case, then the first sentence of the IfMatchActions manual page needs to be corrected. If it's not the case, then... I'm just completely lost. There's some kind of magic smoke inside Rainmeter and it's beyond me; all these black boxes are really starting to wear down my will to continue.
Obviously IfCondition can be used instead, but the prospect of putting "(MeasureName = 2) || (MeasureName = 3) || (MeasureName = 5)..." where "2|3|5|..." has no apparent reason not to work is downright nauseating. My actual temporary solution is to create a second String measure to process the results of the Calc, but that's annoying because I have to decide which one gets the original, usefully descriptive name and what to call the second one. Most importantly, neither solution gets me any closer to understanding WHAT IS THE PROBLEM?
On most forums I wouldn't feel a need to add this, but since you guys respond so startlingly fast, I'm just about to head out and won't be back to reply for a few hours. Thanks in advance for your help, even though there's about a 90% chance that it's going to reveal that I've misjudged the significance of some phrase buried in the manual and make me feel like a complete idiot.