Can such conditional code not be used for strings of any sort?
No, not really. By definition the conditionals take the values they are given and decide whether or not they are 'true' or 'false'. This works great for mathematical equations, for example A+B=C if A is 2 and B is 3 then the conditional would be 'true' if C was 5, but it would be 'false' is C was anything other than 5.
This system simply does not work with strings. Taking the previous example we can modify it to use plain strings like this: The+Cat=Dog. This could never evaluate to true or false in Rainmeter. Words cannot be equal to, or be subtracted from, other words using the
IfConditions. That is what the
IfMatch system is for.
In summary, IfCondition is for Numbers, Equations and Variables with numeric values. Whereas IfMatch is for Strings and Variables with string values.
I'm still a little unclear about !SetVariable...they do use the quotation marks, but I thought that was for strings?
!SetVariable has the same usage and proper formatting as almost all other bangs in Rainmeter. The correct usage of
!SetVariable is:
[color=#0000FF][b][!SetVariable "VariableName" "NewValue" "ConfigContainingVariable"][/b][/color]
Please note that both the [brackets] and the Config parameters are optional. However, notice how every parameter is enclosed in quotations aside from the bang itself? This is to tell Rainmeter where one parameter ends and another begins. This is only needed on parameter values containing spaces, but it's good practice to include it on every parameter anyway.
For example when dealing with Strings:
[b][!SetVariable "PageTitle" [color=#0000FF]"This is a title"[/color]][/b]
*Thanks to the quotations Rainmeter understands that 'This is a title' is one, single parameter.
[b][!SetVariable "PageTitle" [color=#BF0000]This is a title[/color]][/b]
*Without the quotations Rainmeter takes each word as a new parameter. Thus the 'PageTitle' variable will be set to the value of 'This' and the optional 'Config' parameter will be set to the value of 'is' while the remaining words 'a' and 'title' will be ignored.
For example when dealing with Numbers:
[b][!SetVariable "PageNumber" "[color=#0000FF]4[/color]"][/b]
*With quotations the value of 'PageNumber' is set to whatever is inside of them, in this case it's 4.
[b][!SetVariable "PageNumber" "[color=#0000FF](#CurrentPage# + 1)[/color]"][/b]
*With quotations the value of 'PageNumber' is set to whatever is inside of them, in this case it's the equation (#CurrentPage# + 1). Rainmeter needs the quotations because our equation has spaces in it. The variable itself, however, needs (parenthesis) around it so that Rainmeter understands that it's all one entire equation. Without the parenthesis it's likely that Rainmeter would interpret #CurrentPage# + 1 as just #CurrentPage# and ignore everything following the first space since there is nothing telling it to group everything as one.
To sum it up, quotations are needed anytime any
!Bang uses parameters containing spaces. Whether those parameters are numeric-based or string-based does not matter. If it has spaces, it needs quotations.
Parenthesis on the other hand are only needed when a
!Bang contains a parameter containing a mathematical equation which, in turn, contains spaces. The equation 7-4 does
not need parenthesis as it has no spaces, but the equation (7 - 4)
does need parenthesis because it
does have spaces.
Hopefully this cleared things up, but I do tend to be a little long-winded in my explanations so feel free to ask if anything didn't make sense.