It is currently April 23rd, 2024, 12:34 pm

Help with freezing marquees.

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help with freezing marquees.

Post by jsmorley »

Yincognito wrote: February 23rd, 2020, 6:36 pm You're right that the variable doesn't exist and that its value isn't 0. I'll rephrase it then: what I meant was that when the unitialized / nonexistent variable or its associated measures or variables (obtained by using the said variable) are used in a measure or action, the result is 0. In practice, this means that even though the variable itself is not initialized and has no value, the result of an "operation" with that variable exists and is 0. Proof:

Code: Select all

[Variables]
N=2
X=7

[Rainmeter]
DynamicWindowSize=1
AccurateText=1

---Measures---

[MeasureNum]
Measure=Calc
Formula=(#N#)

[MeasureM]
Measure=Calc
Formula=#M#

[MeasureNPlusM]
Measure=Calc
Formula=(#N#+#M#)

---Meters---

[MeterResults]
Meter=String
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
MeasureName=MeasureNPlusM
Text="NPlusM = %1"
UpdateDivider=-1
OnUpdateAction=[!SetVariable NPlusM (#N#+#M#)][!SetVariable XPlusNPlusM (#X#+#NPlusM#)]
LeftMouseUpAction=[!Move "#XPlusNPlusM#" "384"]
RightMouseUpAction=[!UpdateMeter #CURRENTSECTION#]
DynamicVariables=1
M is the unitialized variable.

Ick...

1.png
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with freezing marquees.

Post by balala »

jsmorley wrote: February 23rd, 2020, 7:22 pm Ick...


1.png
Right. When the skin is loaded / refreshed, error messages coming from the fact that the variable isn't initialized comes in the log. Two syntax errors
related to the [MeasureNPlusM] and [MeasureM] measures and two syntax errors related to the two !SetVariable bangs of the OnUpdateAction option of the [MeterResults] meter are shown in the log on refresh. All related to the not existing variable.
User avatar
Yincognito
Rainmeter Sage
Posts: 7149
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help with freezing marquees.

Post by Yincognito »

balala wrote: February 23rd, 2020, 7:47 pm Right. When the skin is loaded / refreshed, error messages coming from the fact that the variable isn't initialized comes in the log. Two syntax errors
related to the [MeasureNPlusM] and [MeasureM] measures and two syntax errors related to the two !SetVariable bangs of the OnUpdateAction option of the [MeterResults] meter are shown in the log on refresh. All related to the not existing variable.
Of course, of course - if you look only at the log. :D But look to the Skins tab for Test.ini to see what value the result of measures and operations with that "scary" variable are, and to what happens when you left click on the skin - and then my statement will have a meaning. Gosh, having a couple of red icons there is not the end of the world - Rainmeter still runs and the skin moves to (0, 384). Q.E.D. ;-)

To be clear, I'm not saying that the "bad" variable gets the value of 0. It's just that the result of handling that variable is a "default" of null - that's all. I misphrased things in the original post, hopefully now it's obvious what I meant...
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with freezing marquees.

Post by balala »

Yincognito wrote: February 23rd, 2020, 7:59 pm To be clear, I'm not saying that the "bad" variable gets the value of 0. It's just that the result of handling that variable is a "default" of null - that's all. I misphrased things in the original post, hopefully now it's obvious what I meant...
Yes, it is. If the variable is used either into a measure, or in an option, both use 0 for the not "declared" variable.
User avatar
Yincognito
Rainmeter Sage
Posts: 7149
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help with freezing marquees.

Post by Yincognito »

balala wrote: February 23rd, 2020, 8:09 pm Yes, it is. If the variable is used either into a measure, or in an option, both use 0 for the not "declared" variable.
Something like that (they actually use 0 for the result involving the undeclared variable, not the undeclared variable itself). And since the OP's syntax error was at IfCondition2=(MeasureCounter>(233+#TextWidth#)), a 0 result of that option was not a big deal there, since the IfTrueAction2 was resetting the counter to 0 anyway (which is more or less what the value of the counter would have been if the variable was initialized to 0 at the start). That's why the OP noticed that the error didn't seem to make the process malfunction.

That is not to say that the error shouldn't have been corrected (which it was, with your help) - it's just that from a practical point of view it was more or less the same as before. By the way, I also had 2 such errors in one of my "newly converted" skins and all went well both before and after correcting them.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with freezing marquees.

Post by balala »

Yincognito wrote: February 23rd, 2020, 8:26 pm And since the OP's syntax error was at IfCondition2=(MeasureCounter>(233+#TextWidth#)), a 0 result of that option was not a big deal there, since the IfTrueAction2 was resetting the counter to 0 anyway (which is more or less what the value of the counter would have been if the variable was initialized to 0 at the start). That's why the OP noticed that the error didn't seem to make the process malfunction.
Agree. However always is a good idea to avoid any kind of the error messages, if possible.
Ok, finally I think this question related to the error messages, is solved. Right?
User avatar
Yincognito
Rainmeter Sage
Posts: 7149
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help with freezing marquees.

Post by Yincognito »

balala wrote: February 23rd, 2020, 8:34 pm Agree. However always is a good idea to avoid any kind of the error messages, if possible.
Ok, finally I think this question related to the error messages, is solved. Right?
Agreed. :thumbup:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth