It is currently April 27th, 2024, 1:54 pm

[Suggestions] Variables in a Variable

Report bugs with the Rainmeter application and suggest features.
User avatar
AlC
Posts: 329
Joined: June 9th, 2011, 6:46 pm

[Suggestions] Variables in a Variable

Post by AlC »

Hey guys,

So new beta phase is starting and this time I don't forget to post this Suggestions:

It would be so nice if we could use variables in a variable.

Example:
#Y_#Config## or ##CurrentSection#Over#
Rainmeter - You are only limited by your imagination and creativity.
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: [Suggestions] Variables in a Variable

Post by Kaelri »

This is not as simple as it appears. :) For instance, should those examples resolve like this?

#Y_#Config##
##CurrentSection#Over#

Or like this?

#Y_#Config##
##CurrentSection#Over#

Without some kind of new syntax, there isn't any good way for Rainmeter to figure out which one you meant.
User avatar
AlC
Posts: 329
Joined: June 9th, 2011, 6:46 pm

Re: [Suggestions] Variables in a Variable

Post by AlC »

Yes, I see :)

So maybe with a combination of special characters.

Maybe with brackets:
#(#CurrentSection#)Over# or #(#Config#)Mode(#Mode#)#
#(#var1#)(#(#var2#)(#var3#)#)#

But I think this isn't the best solution ...
Rainmeter - You are only limited by your imagination and creativity.
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: [Suggestions] Variables in a Variable

Post by MerlinTheRed »

Since variable names can have any special characters in them, this won't work either. The problem is that the variables are opened and closed by the exact same character. Not the wisest choice perhaps, but that's what we have now.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
Unight
Posts: 19
Joined: November 20th, 2012, 5:12 am

Re: [Suggestions] Variables in a Variable

Post by Unight »

AlC wrote:Yes, I see :)

So maybe with a combination of special characters.

Maybe with brackets:
#(#CurrentSection#)Over# or #(#Config#)Mode(#Mode#)#
#(#var1#)(#(#var2#)(#var3#)#)#

But I think this isn't the best solution ...
Forgive my poor English,It sounds a bit like a variable variable,But slightly different,Change your variable name, and the name of the variable is combined into another variable and several characters.
This is similar to the variable variables, such as php.

If
$a=b
$$a=c
Then
$b= c

But prescribed the use of variables in rainmeter inside, is surrounded by the '#' symbol, if you want to achieve the effect you say, I think it will change the pattern how we use variables in rainmeter.