It is currently December 3rd, 2022, 1:48 pm

Nesting Variables

Changes made during the Rainmeter 4.1 beta cycle.
User avatar
jsmorley
Developer
Posts: 22551
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Nesting Variables

Post by jsmorley »

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]

[MeterOne]
Meter=String
FontSize=40
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Hello [\10112] World
1.png
4.1.0 beta r2876 64-bit (Sep 19 2017)
Windows 10 Pro 64-bit (build 15063)
Path: C:\Program Files\Rainmeter\
IniFile: C:\Users\Jeffrey\AppData\Roaming\Rainmeter\Rainmeter.ini
SkinPath: C:\Users\Jeffrey\Documents\Rainmeter\Skins\
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4884
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Nesting Variables

Post by eclectic-tech »

jsmorley wrote:Do you have an example that doesn't work? They work for me.
Here is the code from my "page" meters in EarthquakeMap3 linked above...

Code: Select all

[QuakesPage1]
Meter=String
X=4R
Y=r
Text="[/10102]"
SolidColor=255,255,255,190
LeftMouseUpAction=[!WriteKeyValue Variables Page 1 "#@#Variables.inc"][!Refresh]
ToolTipText="Display 1~30"
UpdateDivider=30

[QuakesPage2]
Meter=String
X=2R
Y=r
Text="[/10113]"
SolidColor=255,255,255,190
LeftMouseUpAction=[!WriteKeyValue Variables Page 2 "#@#Variables.inc"][!Refresh]
ToolTipText="Display 31~60"
UpdateDivider=30

[QuakesPage3]
Meter=String
X=2R
Y=r
Text="[/10114]"
SolidColor=255,255,255,190
LeftMouseUpAction=[!WriteKeyValue Variables Page 3 "#@#Variables.inc"][!Refresh]
ToolTipText="Display 61~90"
UpdateDivider=30

eq4.png
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22551
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Nesting Variables

Post by jsmorley »

It's not "/", it's "\"
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4884
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Nesting Variables

Post by eclectic-tech »

jsmorley wrote:[/10112] wouldn't be right... it would be [\10112]
I noticed that... Tried both and neither show the characters!?

EDIT: Never mind :o I need to change a measure that also sets those.... Thanks for noticing my TYPO...
Last edited by eclectic-tech on September 19th, 2017, 11:03 pm, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 22551
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Nesting Variables

Post by jsmorley »

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]

[MeterOne]
Meter=String
FontSize=40
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text="[\10113]"
1.png
You don't in any way need the quotes of course, but they don't hurt anything.
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4884
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Nesting Variables

Post by eclectic-tech »

Found my TYPO :oops: ... Thanks for noticing!
User avatar
jsmorley
Developer
Posts: 22551
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Nesting Variables

Post by jsmorley »

I'm a bit confused by the SolidColor but no FontColor?
User avatar
jsmorley
Developer
Posts: 22551
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Nesting Variables

Post by jsmorley »

eclectic-tech wrote:Found my TYPO :oops: ... Thanks for noticing!
Ah good...
User avatar
raiguard
Posts: 660
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Re: Nesting Variables

Post by raiguard »

Are we certain that we shouldn’t discourage the use of the old syntax in the future? If all new variable types are going to use this syntax, it would seem like a good idea to make everything consistent and encourage only the use of new variables going forward.
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
Brian
Developer
Posts: 2535
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Nesting Variables

Post by Brian »

raiguard wrote:Are we certain that we shouldn’t discourage the use of the old syntax in the future? If all new variable types are going to use this syntax, it would seem like a good idea to make everything consistent and encourage only the use of new variables going forward.
Normally we would encourage the use of any new 'features' or syntax. However, since the 'nesting' syntax is so new, it is going to take a lot time for people to learn how and when to use this new syntax.

So for now, I think we should refer to the new-style variable syntax as a 'alternative' form, instead of 'deprecating' the old-style. There is really no benefit to use the new-style syntax if there is no nesting involved. Possibly in the future when the new-style variables is the 'norm', we may deprecate the old-style. That is a discussion we will likely need to have in the future.

-Brian