It is currently August 18th, 2019, 5:55 am

[Feature] Combine SetVariable & WriteKeyValue

Report bugs with the Rainmeter application and suggest features.
User avatar
StArL0rd84
Posts: 336
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

[Feature] Combine SetVariable & WriteKeyValue

StArL0rd84 » June 7th, 2019, 5:13 pm

Most of the time when changing a variable it needs to be remembered after the current session, but also be changed "right now".
Not refreshing, but rather just update the depending meter followed by a redraw. And then using DynamicVariables on the meter.

This can result in some VERY long lines of bangs!
I suggest keeping the old bangs, but still adding the new bang.
So in stead of: [!SetVariable App1 "#Path1#"][!WriteKeyValue Variables App1 "#Path1#" "#Var#"]
It could be something like: [!StoreVariable App1 "#Path1#" "#Var#"]

This topic has been discussed in the past elsewhere on this forum but i cannot find the thread.
Was just wondering what the developers thoughts on something like this concept would be in 2019?

And then a bonus question...
It might be more of a niche situation, but could also be quite handy to have a bang that could swap two variables around.
So in stead of: [!SetVariable App1 "#App2#"][!WriteKeyValue Variables App1 "#App2#" "#Var#"][!SetVariable App2 "#App1#"][!WriteKeyValue Variables App2 "#App1#" "#Var#"]
It could be: [!SwapVariable "App1" "App2" "#Var#"]
(#WorkTime# = 1 ? #Work# : ([mEnergyLoss:%] > 100 ? #SleepMode# : #Rainmeter#))
User avatar
jsmorley
Developer
Posts: 19371
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Feature] Combine SetVariable & WriteKeyValue

jsmorley » June 7th, 2019, 11:29 pm

Cariboudjan
Posts: 9
Joined: May 12th, 2019, 8:55 am

Re: [Feature] Combine SetVariable & WriteKeyValue

Cariboudjan » June 8th, 2019, 11:51 pm

I like the swap variable idea. I don't know where I'd use it, but I like it.
User avatar
StArL0rd84
Posts: 336
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: [Feature] Combine SetVariable & WriteKeyValue

StArL0rd84 » June 10th, 2019, 5:11 pm

Cariboudjan wrote:
June 8th, 2019, 11:51 pm
I like the swap variable idea. I don't know where I'd use it, but I like it.
One example could be a launcher.
You could then scroll up / down over a listed item and swap the variables for path, name etc between the two.
Can be done with setvariable and writekeyvalue,
But the !swap would be cleaner and easier code to write.
(#WorkTime# = 1 ? #Work# : ([mEnergyLoss:%] > 100 ? #SleepMode# : #Rainmeter#))