It is currently May 5th, 2024, 9:04 pm

[Bug or Out of Bounds?]Section variable parameters

Report bugs with the Rainmeter application and suggest features.
User avatar
Yincognito
Rainmeter Sage
Posts: 7200
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

[Bug or Out of Bounds?]Section variable parameters

Post by Yincognito »

Ok, so I'm sort of a "bug" finder lately, hahaha! Guess it's because of my constant desire to "tweak" things in Rainmeter...

Anyway, not sure if this is a "bug" or more of an "out of bounds" issue. But whatever it is, it's not letting me build my "tooltip autoscale" properly, as I use this sort of operations on section variables. If it's a bug, it should be revealed to Rainmeter developers, if it's an "out of bounds" issue, a short mention on it should appear in the related section of the Rainmeter manual.

Here is the code:

Code: Select all

[Rainmeter]
Update=1000

[Metadata]
Name=whatever
Description=whatever
Instructions=whatever
Version=whatever
Author=Yincognito
License=Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

[Measure1]
Measure=Calc
Formula=2147483648
RegExpSubstitute=1
Substitute="^.*$":"[#CURRENTSECTION#:/2147483648]"
DynamicVariables=1

[Meter1]
Meter=STRING
StringAlign=Left
StringStyle=Bold
ClipString=2
FontFace=Tahoma
FontColor=255,255,255,255
StringEffect=Shadow
FontSize=12
SolidColor=255,0,0,255
AntiAlias=1
X=0
Y=0
W=200
H=20
MeasureName=Measure1
Text="%1"
ToolTipText="%1"
DynamicVariables=1
Now, as expected, the text being shown up in the meter is close to 1, considering I'm dividing a number by itself in the related measure (for the sake of clarity).

The 2147483648 divisor number above is 2^31. The problem arises when replacing the number with 4294967296 (2^32) and above numbers. The results start to derail to wrong values.

It seems the number in the :/n parameter in the section variables is limited to 2^31, as replacing the dividend (the value of the Formula option) with higher values is "allowed", but when trying to replace the divisor (the number in the :/n parameter) with a higher value than 2^31 leads to the divisor value being "limited" to 2^31.

I need this to function, as it doesn't allow to compute terabyte (1099511627776 bytes) values properly.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Brian
Developer
Posts: 2689
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: [Bug or Out of Bounds?]Section variable parameters

Post by Brian »

This is a 'out of bounds' issue. For section variables, the max scale is 2147483647 (which is 2^31 -1, or the integer max). Anything over the max will just result in the max being used for scaling.

Although changing/fixing this is trivial, I would have to consult with the team on any problems and/or backward-compatibility issues that could arise (even though I doubt there would be any).

-Brian
User avatar
Yincognito
Rainmeter Sage
Posts: 7200
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Bug or Out of Bounds?]Section variable parameters

Post by Yincognito »

Brian wrote:This is a 'out of bounds' issue.
Thought so...
Brian wrote:Although changing/fixing this is trivial, I would have to consult with the team on any problems and/or backward-compatibility issues that could arise (even though I doubt there would be any).
Ok then, thanks for aknowledging this ;)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth