Would it be possible to implement "Array" variables within Rainmeter?
Thanks for any help or suggestions.
It is currently March 29th, 2024, 12:03 pm
Array Variables
-
- Posts: 10
- Joined: April 21st, 2013, 1:46 pm
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Array Variables
I'd say it's not, but what are you exactly thinking about?LordgodEric wrote: ↑February 9th, 2019, 10:47 am Would it be possible to implement "Array" variables within Rainmeter?
-
- Posts: 10
- Joined: April 21st, 2013, 1:46 pm
Re: Array Variables
Mainly being able to process an unknown number of the same calculations on some data sets without having to individually name each variable or measure. So I could use just one "function" measure (calculation) to perform the function. I imagine this could be done via Lua plugin, but the tutorials I have found are kind of vague as to how exactly it links into Rainmeter and how to pass data back and forth.
-
- Posts: 100
- Joined: April 30th, 2017, 11:51 am
Re: Array Variables
I believe you need loops for such a thing. Rainmeter isn't built to have loops, they are quite tricky to write.LordgodEric wrote: ↑February 15th, 2019, 11:48 aman unknown number of the same calculations on some data sets
I really doubt it will be easier to use than scripts in Lua.
I'm not a Rainmeter dev but I say that measures aren't ever gonna be defined as arrays.LordgodEric wrote: ↑February 15th, 2019, 11:48 amhaving to individually name each variable or measure
If you only need to access them using some index then you can use nested variables. Write
Code: Select all
[variables]
qwe_1=a
qwe_2=b
x=1
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Array Variables
Or, beside rxtd's reply, as you thought, a Lua script can be used (it's not a plugin though). If properly written (to use Inline Lua) it is an extremely versatile tool.LordgodEric wrote: ↑February 15th, 2019, 11:48 am Mainly being able to process an unknown number of the same calculations on some data sets without having to individually name each variable or measure. So I could use just one "function" measure (calculation) to perform the function. I imagine this could be done via Lua plugin, but the tutorials I have found are kind of vague as to how exactly it links into Rainmeter and how to pass data back and forth.
For example, in the attached skin, the value of the [MeasureCalc] measure is increased by 1 at each update of the skin. This value is get by the Double function of the lua script file and doubled by this function. The result is returned to the String meter of the skin. Obviously a such operation can be made much more easier by a simple Calc measure, the meaning of this lua script is just to demonstrate how this Inline Lua feature is working.
Also note that if inline lua is used, the [MeasureLuaScript] Script measure can be even disabled (and in this case it is), the function used through it still works.
You do not have the required permissions to view the files attached to this post.
-
- Posts: 10
- Joined: April 21st, 2013, 1:46 pm
Re: Array Variables
Thanks for all the info folks.
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Array Variables
Did the Inline Lua help?
-
- Posts: 10
- Joined: April 21st, 2013, 1:46 pm
Re: Array Variables
Sorry, it took me so long to get back to you. But yes the inline lua did work. It was a little tricky but it did work thanks.
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Array Variables
Ok, I'm glad.LordgodEric wrote: ↑November 6th, 2019, 11:37 am But yes the inline lua did work. It was a little tricky but it did work thanks.