It is currently April 27th, 2024, 11:58 am

Max Variables in Formula

Get help with creating, editing & fixing problems with skins
User avatar
catorskeneeble
Posts: 3
Joined: March 28th, 2011, 3:13 pm

Max Variables in Formula

Post by catorskeneeble »

So I've been messing around with Rainmeter for a little under a week and I can't seem to get formulas with more than three variables to return a non-zero value. I alternatively tried splitting this formula into two discrete parts and still run into the same issues. I suppose it may be a problem with formula length. Has anyone else run into similar issues?

Code: Select all

[Variables]
A = 1
B = 2
C = 3
D = 4

[Sum]
Measure = Calc
Formula = #A# + #B# + #C# + #D# ;does not return 10

[Sum_1]
Measure = Calc
Formula = #A# + #B#

[Sum_2]
Measure = Calc
Formula = #A# + #B#

[Sum_3]
Measure = Calc
Formula = Sum_1 + Sum_2 ;doesn't return 10 either
I should probably mention that the variables are actually named something like #Border_Offset_X# to give you an idea of how many characters this formula consumes.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Max Variables in Formula

Post by jsmorley »

Seems to work fine for me. All I did was remove the inline comments on the Formula= statements that seemed to be generating a "Syntax error", and I got this:
3-28-2011 11-31-21 AM.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
catorskeneeble
Posts: 3
Joined: March 28th, 2011, 3:13 pm

Re: Max Variables in Formula

Post by catorskeneeble »

I'll give it another run through when I get back home. I appreciate your help. After checking a few other skins, it looks like here isn't a discernible limit on character inputs per formula either. This is pretty unsettling because I thought I was a decent coder until now, lol...

Also, is that notepad++? It looks like a pretty decent editor and MS notepad just isn't cutting it anymore
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Max Variables in Formula

Post by jsmorley »

User avatar
catorskeneeble
Posts: 3
Joined: March 28th, 2011, 3:13 pm

Re: Max Variables in Formula

Post by catorskeneeble »

Oh damn! I should've seen this when you removed the inline comments! That's why my variables started breaking my formulas. It makes me sad that Rainmeter doesn't like that style of commenting. Thanks so much~

On another note, I don't suppose there's some way to make block-style comments (/* ohai */)?
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Max Variables in Formula

Post by jsmorley »

catorskeneeble wrote:Oh damn! I should've seen this when you removed the inline comments! That's why my variables started breaking my formulas. It makes me sad that Rainmeter doesn't like that style of commenting. Thanks so much~

On another note, I don't suppose there's some way to make block-style comments (/* ohai */)?
There is not, sorry. Rainmeter just uses a very standard .ini format, and the format does not support block comments. It should however support inline comments, we will have to look at that.