It is currently April 16th, 2024, 9:31 pm

Variables in variables.

Report bugs with the Rainmeter application and suggest features.
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Variables in variables.

Post by JpsCrazy »

I'm trying to make a very user friendly Variables that basically can change EVERY measure in the skin just from that.
So, I ended up trying to use Variables within [Variables] to make it really simple for any user.
Then I had to change half of it, because you can't use variables in the [Variables] section.

Here's what I did:
[Variables]
0=#Measure9#
1=#Measure2#
2=#Measure2#
3=#Measure2#
4=#Measure1#
5=#Measure8#

Measure1=CPU
Measure2=FreeDiskSpace
Measure3=Memory
Measure4=NetIn
Measure5=NetOut
Measure6=NetTotal
Measure7=Perfmon
Measure8=PhysicalMemory
Measure9=Plugin
Measure10=SwapMemory
This way, anyone who uses it know all the possible measures working for this skin.
I also did it with plugins.

Make it happen?
User avatar
Alex2539
Rainmeter Sage
Posts: 642
Joined: July 19th, 2009, 5:59 am
Location: Montreal, QC, Canada

Re: Variables in variables.

Post by Alex2539 »

You can refer to other variables within the [Variables] section, but there are two conditions:
1) No dynamic variables. It will only ever use the initial value of the variable.
2) The variable you are referring to must have already been declared higher up in the file.

So you could do this:

Code: Select all

[Variables]
Measure1=CPU
Measure2=FreeDiskSpace
Measure3=Memory
Measure4=NetIn
Measure5=NetOut
Measure6=NetTotal
Measure7=Perfmon
Measure8=PhysicalMemory
Measure9=Plugin
Measure10=SwapMemory

0=#Measure9#
1=#Measure2#
2=#Measure2#
3=#Measure2#
4=#Measure1#
5=#Measure8#
ImageImageImageImage
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Variables in variables.

Post by JpsCrazy »

Oh. Well that makes sense. Ahaa.
I feel smart.

Thanks!