It is currently March 28th, 2024, 11:33 pm

Real basic parameter question

Get help with creating, editing & fixing problems with skins
User avatar
Codger
Posts: 97
Joined: May 29th, 2017, 3:16 pm

Real basic parameter question

Post by Codger »

I'll use the excuse that I've been up much too long and have not had to do this before.

I want to do this: [!Move #CURRENTCONFIGX# [StackPos:20] "Codger\WiFi"]

StackPos is just a Calc measure that adds the parameter to #CURRENTCONFIGY#

And I have no idea how to reference the parameter inside the measure.
What is the syntax? Also, I can't find it anywhere in the manual. Some examples on the sending end but I can't find any on the receiving. Could you point me to it?

Thanks
[hr][/hr][hr][/hr]
"If you are the smartest one in the room, you are in the wrong room."
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Real basic parameter question

Post by jsmorley »

Well, I can't imagine what you are trying to accomplish with this, as basing the X position of skin on the screen on the Y position of the skin on the screen doesn't seem... useful, but:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[MeasureOnLoad]
Measure=Calc
Formula=Counter
IfCondition=MeasureOnLoad <= 1 
IfTrueAction=[!Move #CURRENTCONFIGX# [StackPos] "Codger\WiFi"]
DynamicVariables=1

[StackPos]
Measure=Calc
Formula=#CURRENTCONFIGY# + 20
DynamicVariables=1

[MeterOne]
Meter=String
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Hello World
Note that I used the !Move bang in a Calc measure, rather than in an OnRefreshAction in the [Rainmeter] section. This is because variables like #CURRENTCONFIGX# and #CURRENTCONFIGY# must use DynamicVariables=1 in order to get the current value as you drag the skin around on the screen, and [Rainmeter] does not support DynamicVariables.

I use the Counter function in the Calc measure, which is not "reset" when the skin is refreshed, so the move will only happen when the skin is first loaded.

But all that aside, since I have no idea why you would want to do this, the basic answer to your question is:

You reference the value of a Measure by using it as a [SectionVariable], which will just "replace" the [SectionVariable] with the "value" of the measure where it is used. You must use DynamicVariables=1 to ensure that the most current value of the measure is used.

https://docs.rainmeter.net/manual/variables/section-variables/

Not quite sure what you are going for with [StackPos:20] but what that says is "give me the number value of the measure StackPos, with 20 decimal places." There can't be useful decimal places in pixel measurements outside of the Shape meter.

https://docs.rainmeter.net/manual/variables/section-variables/#Decimals


Aside:

Not sure why you are referencing a Calc measure to do this, as:

IfTrueAction=[!Move #CURRENTCONFIGX# (#CURRENTCONFIGY#+20) "Codger\WiFi"]

Would do the same thing, with a lot less hassle and no need for [StackPos] at all.
User avatar
Codger
Posts: 97
Joined: May 29th, 2017, 3:16 pm

Re: Real basic parameter question

Post by Codger »

Lots of useful information there about why not to do it the way I want but let's assume I had a sane reason that I simplified down to singular question. And unless I am missing something very fundamental (probably the case) one that didn't get answered.

Code: Select all

[blah]
blah blah
blah blah [Routine:20] blah blah
blah blah [Routine:45] blah blah
blah

[Routine]
Measure=Calc
<something here?>
Formula=#avalue#+<some way of referencing passed parameter>
DynamicVariables=1
Can you please fill in the <> parts?
[hr][/hr][hr][/hr]
"If you are the smartest one in the room, you are in the wrong room."
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Real basic parameter question

Post by jsmorley »

Codger wrote:Lots of useful information there about why not to do it the way I want but let's assume I had a sane reason that I simplified down to singular question. And unless I am missing something very fundamental (probably the case) one that didn't get answered.

Code: Select all

[blah]
blah blah
blah blah [Routine:20] blah blah
blah blah [Routine:45] blah blah
blah

[Routine]
Measure=Calc
<something here?>
Formula=#avalue#+<some way of referencing passed parameter>
DynamicVariables=1
Can you please fill in the <> parts?
There is no such thing as "passed parameters" in Rainmeter. A measure can "go get" the value of some other measure.

[MeasureOne]
Measure=Calc
Formula=20

[MeasureTwo]
Measure=Calc
Formula=100 + [MeasureOne]
DynamicVariables=1
User avatar
Codger
Posts: 97
Joined: May 29th, 2017, 3:16 pm

Re: Real basic parameter question

Post by Codger »

jsmorley wrote:There is no such thing as "passed parameters" in Rainmeter. A measure can "go get" the value of some other measure.
I was beginning to suspect that. Wrote it another way with 15 tiny calc measures.
What are the references to [somemeasure:parameter1,parameter2] in the Section Variables page all about?

Thanks for your time.
[hr][/hr][hr][/hr]
"If you are the smartest one in the room, you are in the wrong room."
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Real basic parameter question

Post by jsmorley »

Codger wrote:What are the references to [somemeasure:parameter1,parameter2] in the Section Variables page all about?
That is how you specify more than one of the measure parameters supported by section variables.

Like telling it you want it scaled by 1024 and with 2 decimal places.

The measure parameters that support multiple parameters are indicated in the docs with Multiple Parameters: in their description.
User avatar
Codger
Posts: 97
Joined: May 29th, 2017, 3:16 pm

Re: Real basic parameter question

Post by Codger »

I understand now. Thank you for your patience. I get cranky when I'm stupid, :confused:
[hr][/hr][hr][/hr]
"If you are the smartest one in the room, you are in the wrong room."
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Real basic parameter question

Post by jsmorley »

I have to say that:
Wrote it another way with 15 tiny calc measures.
Leads me to believe you are missing some easier way. No way that should be needed.

Example:

Code: Select all

[MeasurePos]
Measure=Calc
Formula=10+5

[MeterString]
Meter=String
X=[MeasurePos]
DynamicVaribales=1
Is just not needed.

Code: Select all

[MeterString]
Meter=String
X=(10 + 5)
Works fine.
User avatar
Codger
Posts: 97
Joined: May 29th, 2017, 3:16 pm

Re: Real basic parameter question

Post by Codger »

Largely for readability as it is a section that will have to be modified from time to time.
It is the one skin in the suite I am still working on so it might change. That often occurs towards the end - a sudden rampant inspired rewrite.

But currently two bugs left and the suite will be finished. (finger crossed) :thumbup:

Image
[hr][/hr][hr][/hr]
"If you are the smartest one in the room, you are in the wrong room."
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Real basic parameter question

Post by jsmorley »

Looking good...