It is currently March 9th, 2021, 10:50 am

Thought I had this fixed: SetOption 1 step behind [solved]

Help with creating, editing & fixing problems with skins
User avatar
CodeCode
Posts: 271
Joined: September 7th, 2020, 2:24 pm

Thought I had this fixed: SetOption 1 step behind [solved]

Post by CodeCode »

Hello, I have a series of Variables in an .inc file that are meant to be set with !WriteKeyValue and !SetOption Bangs.
#Num# is 0 to 4, but just the first one here since they all work the same in the end.
Code:

Code: Select all

[MeasureWCNums]
Measure=Calc
Formula=0
IfCondition=(#Num# = 0)
IfTrueAction=[!WriteKeyValue Variables C #TZ1M# "#@#RoundVariables.inc"][!WriteKeyValue Variables CText #TZ1MText# "#@#RoundVariables.inc"][!WriteKeyValue Variables E #TZ1T# "#@#RoundVariables.inc"][!WriteKeyValue Variables EText #TZ1TText# "#@#RoundVariables.inc"][!WriteKeyValue Variables W #TZ1B# "#@#RoundVariables.inc"][!WriteKeyValue Variables WText #TZ1BText# "#@#RoundVariables.inc"][!SetOption Variables C #TZ1M# "#@#RoundVariables.inc"][!SetOption Variables CText #TZ1MText# "#@#RoundVariables.inc"][!SetOption Variables E #TZ1T# "#@#RoundVariables.inc"][!SetOption Variables EText #TZ1TText# "#@#RoundVariables.inc"][!SetOption Variables W #TZ1B# "#@#RoundVariables.inc"][!SetOption Variables WText #TZ1BText# "#@#RoundVariables.inc"][!Update]
What am I missing for all the variables are not updating right off?
DynamicVariables is also set for the Calc Measure this code is appearing in.
Last edited by CodeCode on February 17th, 2021, 2:39 am, edited 1 time in total.
Can't fix it if it ain't broke - unless it is in code.
User avatar
jsmorley
Developer
Posts: 21564
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thought I had this fixed: SetOption 1 step behind

Post by jsmorley »

You can't use !SetOption to dynamically change a variable. You use !SetVariable. !SetOption ONLY works on measures and meters. And with !SetVariable (and !SetOption for that matter), you DON'T specify a file name to set them in. You specify a running "config", defaulting to the current one. Only !WriteKeyValue can write to an actual file. Assuming that RoundVariables.inc is being @Include loaded in the config this action is in, then no config name is required.

https://docs.rainmeter.net/manual/bangs/#SetVariable
https://docs.rainmeter.net/manual/skins/#Config
User avatar
CodeCode
Posts: 271
Joined: September 7th, 2020, 2:24 pm

Re: Thought I had this fixed: SetOption 1 step behind

Post by CodeCode »

Cool. I have changed things to fit properly with use and intent.
However, the the variables remain 1 step behind and only a refresh gets things in line to match the skin and the included RoundVariables.inc.

Code: Select all

[MeasureWCNums]
Measure=Calc
Formula=0
IfCondition=(#Num# = 0)
IfTrueAction=[!WriteKeyValue Variables C #TZ1M# "#@#RoundVariables.inc"][!WriteKeyValue Variables CText #TZ1MText# "#@#RoundVariables.inc"][!WriteKeyValue Variables E #TZ1T# "#@#RoundVariables.inc"][!WriteKeyValue Variables EText #TZ1TText# "#@#RoundVariables.inc"][!WriteKeyValue Variables W #TZ1B# "#@#RoundVariables.inc"][!WriteKeyValue Variables WText #TZ1BText# "#@#RoundVariables.inc"][!SetVariable Variables C #TZ1M#][!SetVariable Variables CText #TZ1MText#][!SetVariable Variables E #TZ1T#][!SetVariable Variables EText #TZ1TText#][!SetVariable Variables W #TZ1B#][!SetVariable Variables WText #TZ1BText#][!Update]
I'm still missing something... but what is it?
Can't fix it if it ain't broke - unless it is in code.
User avatar
jsmorley
Developer
Posts: 21564
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thought I had this fixed: SetOption 1 step behind

Post by jsmorley »

You need to use DynamicVariables=1 on all measures and / or meters where you use those #Variables#.
User avatar
CodeCode
Posts: 271
Joined: September 7th, 2020, 2:24 pm

Re: Thought I had this fixed: SetOption 1 step behind

Post by CodeCode »

OK. I realised that mentioning the "Variables" parameter is unnecessary as the !SEtVariable Bang does that by natural function and not required.5

It works now, like this:

Code: Select all

[MeasureWCNums]
Measure=Calc
Formula=0
IfCondition=(#Num# = 0)
IfTrueAction=[!WriteKeyValue Variables C #TZ1M# "#@#RoundVariables.inc"][!WriteKeyValue Variables CText #TZ1MText# "#@#RoundVariables.inc"][!WriteKeyValue Variables E #TZ1T# "#@#RoundVariables.inc"][!WriteKeyValue Variables EText #TZ1TText# "#@#RoundVariables.inc"][!WriteKeyValue Variables W #TZ1B# "#@#RoundVariables.inc"][!WriteKeyValue Variables WText #TZ1BText# "#@#RoundVariables.inc"][!SetVariable C #TZ1M#][!SetVariable CText #TZ1MText#][!SetVariable E #TZ1T#][!SetVariable EText #TZ1TText#][!SetVariable W #TZ1B#][!SetVariable WText #TZ1BText#][!Update]
Can't fix it if it ain't broke - unless it is in code.
User avatar
jsmorley
Developer
Posts: 21564
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thought I had this fixed: SetOption 1 step behind [solved]

Post by jsmorley »

Good deal...