It is currently May 7th, 2024, 3:20 pm

Need to initialize the variable for max disk space Error

Get help with creating, editing & fixing problems with skins
thefather10x
Posts: 4
Joined: March 31st, 2012, 10:07 pm

Need to initialize the variable for max disk space Error

Post by thefather10x »

Hey i am a noob at this since i only installed it yesterday, and i wanted to make a % for free disk space. I got an error that i wanna get rid of it.

The error is it's giving me this:

Calc: #Infinity somewhere! in [MeasureProcentageFull1]

it gives me the error two times.
i dunno what other info is needed.

I need to initialize the variable that stores my max disk space.
It works alright but it gives me an error right when it initializes, after the bytes are red it's ok but it just gives me an error and i wanna get rid of it.

code here:

Code: Select all

[measureTotalDisk1]
; This measure returns the total disk space
Measure=FreeDiskSpace
Drive=#disk1#
Total=1
UpdateDivider=120

[measureUsedDisk1]
; Returns inverted value of free disk space (i.e. used disk space)
Measure=FreeDiskSpace
Drive=#disk1#
InvertMeasure=1
UpdateDivider=120

[MeasureTotalnr1]
Measure=Calc
Formula=measureTotalDisk1
DynamicVariables=1

[MeasureTotalDisk2]
Measure=FreeDiskSpace
Drive=#disk2#
Total=1
UpdateDivider=120
Substitute="0":'1'

.......

[MeasureProcentageFull1]
Measure=Calc
Formula=((MeasureTotalnr1-MeasureUsednr1)/MeasureTotalnr1) *100
DynamicVariables=1
i hope somebody can help!
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Need to initialize the variable for max disk space Error

Post by jsmorley »

Hard to say. The measure [MeasureUsednr1] that is referenced in your formula does not exist anywhere in the skin sample you sent, so I just get "Calc: "MeasureUsednr1" is unknown in [MeasureProcentageFull1]" errors once a second.

In general though, you need to be aware that all measures in Rainmeter are set to "0" when a skin is first loaded or refreshed, and don't contain a value until the second update cycle of the skin. So you need to be careful about "divide by zero" errors in formulas. Not sure that is what you are seeing, but I can't replicate your error.
thefather10x
Posts: 4
Joined: March 31st, 2012, 10:07 pm

Re: Need to initialize the variable for max disk space Error

Post by thefather10x »

wow quick reply i think i forgot to paste these in but like i said it gives me an error just as u said divide by 0 and only for 2 cycles

this is the adition to the code and bot is the rest so u can see what's going on it's just a test i'm trying to make my own skin and trying to figure out the basics.

Code: Select all

[MeasureTotalnr1]
Measure=Calc
Formula=measureTotalDisk1
DynamicVariables=1

[MeasureUsednr1]
Measure=Calc
Formula=measureUsedDisk1
DynamicVariables=1

[MeasureProcentageFull1]
Measure=Calc
Formula=((MeasureTotalnr1-MeasureUsednr1)/MeasureTotalnr1) *100
DynamicVariables=1

:whole code i think should work

Code: Select all

[Rainmeter]
Author=thefather
Appversion=20000
Update=1000

[Metadata]
Description=testing

[Variables]
fontName=Trebuchet MS
textSize=8
colorBar=255,255,255,255
colorBack=255,0,0,255
colorText=255,0,0,255
tintcolour=0,0,0,0
disk1=C:
disk1=C:
disk2=D:
disk3=E:
disk4=F:
disk5=G:
disk6=I:

[styleLeftText]
StringAlign=LEFT
; Meters using styleLeftText will be left-aligned.
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorBack#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleBar2]
BarColor=#colorBar#
BarOrientation=VERTICAL
SolidColor=255,255,255,45

[styleBar]
BarColor=#colorBar#
BarOrientation=HORIZONTAL
SolidColor=255,0,0,90

[meterBackground]
Meter=IMAGE
ImageName=#SKINSPATH#\illustro\Testback\round.png
; #SKINSPATH# is a global variable that stands for your skin path. It is
; usually Documents\Rainmeter\Skins.
ImageTint=#tintcolour#
X=0
Y=0
[MeasureDiskLabel1]
Measure=FreeDiskSpace
Drive=C:
IgnoreRemovable=0
Label=1
Substitute="":"C:"

[measureTotalDisk1]
; This measure returns the total disk space
Measure=FreeDiskSpace
Drive=#disk1#
Total=1
UpdateDivider=120

[measureUsedDisk1]

; Returns inverted value of free disk space (i.e. used disk space)
Measure=FreeDiskSpace
Drive=#disk1#
InvertMeasure=1
UpdateDivider=120

[MeasureTotalnr1]
Measure=Calc
Formula=measureTotalDisk1
DynamicVariables=1

[MeasureUsednr1]
Measure=Calc
Formula=measureUsedDisk1
DynamicVariables=1

[MeasureProcentageFull1]
Measure=Calc
Formula=((MeasureTotalnr1-MeasureUsednr1)/MeasureTotalnr1) *100
DynamicVariables=1


[mDiskIn1]

Meter=BAR
MeterStyle=styleBar
MeasureName=measureUsedDisk1
X=4
Y=16
W=80
H=2
LineColor=FFFFFFFF
LineWidth=4
AntiAlias=1

[mLabelDisk1]
Meter=String
MeterStyle=styleLeftText
MeasureName=measureDiskLabel1
MeasureName2=MeasureProcentageFull1
MeasureName3=MeasureTotalnr1
MeasureName4=MeasureUsednr1

NumOfDecimals=0
AutoScale=1

X=4
Y=2
W=80
H=40
Text="%1LocalDisk:%2"

i think i missed some variables but it should work if the colours r changed
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Need to initialize the variable for max disk space Error

Post by jsmorley »

That code in the bottom box works just fine for me, and the only error I get is for the missing background image I don't have. What version of Rainmeter are you on?
thefather10x
Posts: 4
Joined: March 31st, 2012, 10:07 pm

Re: Need to initialize the variable for max disk space Error

Post by thefather10x »

2.2
i can post a ss if u want of the error. it worked fine for me to but after i restarted rainmeter it popped that error like i said it's only when i refresh it one time
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Need to initialize the variable for max disk space Error

Post by jsmorley »

You might try the 2.3 beta at http://rainmeter.net and see if that makes any difference.
thefather10x
Posts: 4
Joined: March 31st, 2012, 10:07 pm

Re: Need to initialize the variable for max disk space Error

Post by thefather10x »

well i upgraded and no more error thx

i thought the beta still had bugs i wanted a stable one
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Need to initialize the variable for max disk space Error

Post by jsmorley »

thefather10x wrote:well i upgraded and no more error thx

i thought the beta still had bugs i wanted a stable one
There are no existing bugs in 2.3 beta that I am aware of, should mostly be some small additions / changes going forward until we release 2.3.