deflore08 wrote: ↑August 3rd, 2020, 11:29 pm
As i know, Rainmeter have !SetVariable and !WriteKeyValue bangs.
In situations when we have to change a variable and remember new value, we using both bangs. I quess, Rainmeter knows the place (original file and and path to file) where used variable stores, so it would be convinient so Set and Write a value through 1 bang rather than 2. It would make code more short and nice, don't we?
Code: Select all
[!SetVariable VAR "Value"][!WriteKeyValue Variables VAR "Value" "#@#file.inc"]
VS
Yeah, while it may make the code shorter and be more comfortable to work with, it's really not about comfort here, but about functionality. The two bangs do different things: one writes the variable value to the memory, the other writes it to a file. One of Rainmeter's strengths is to "break up" an operation into "modular processes" that do just one thing only, so that the user can choose what part of the operation to do - a simple example is breaking up the whole update process of a meter into the "technical update", i.e. !UpdateMeter and the "visual update", i.e. !Redraw. This allows for greater flexibility (and clarity) in handling things, of course at the expense of comfort and options' length.
Personally, I don't see much value in having a !WriteVariable bang implemented, but then it's not my call to make and, of course, I could be wrong with this. I mean, it's not like we'd be able to break up long options or put bangs on separate lines anyway...
P.S. One can reduce the options' length by placing the bangs into variables as well. You can even place those variables on separate lines, like this (you'd have to remember the naming convention you use though, which might create an additional issue with debugging the skin a couple of months later, when you forgot what each "abbreviation" means):
Code: Select all
[Variables]
SV=[!SetVariable VAR "Value"]
WKV=[!WriteKeyValue Variables VAR "Value" "#@#file.inc"]
...
...
...
LeftMouseUpAction=#SV##WKV#
I used LeftMouseUpAction as an example, it could be any other "action" option there.