It is currently July 27th, 2021, 3:07 pm

[BUG?] in Multiple usage of #CURRENTSECTION#

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

Re: [BUG?] in Multiple usage of #CURRENTSECTION#

Post by Yincognito »

death.crafter wrote: June 29th, 2021, 11:52 pm I am afraid not... You can check my log up there
I believe you, but I tried the bits you posted thus far (you initial post, typo corrected) and they worked, see above. Maybe I'm missing something?
P.S. At first I thought you were right, but it was because of a mistake I made.
User avatar
death.crafter
Posts: 501
Joined: April 24th, 2021, 8:13 pm

Re: [BUG?] in Multiple usage of #CURRENTSECTION#

Post by death.crafter »

Yincognito wrote: June 30th, 2021, 1:45 am I believe you, but I tried the bits you posted thus far (you initial post, typo corrected) and they worked, see above. Maybe I'm missing something?
Active Colors wrote: June 30th, 2021, 12:22 am If it is happening with your code maybe you can pack your skin and attach here? Hopefully it will get resolved too.
!Ignore
Now this is even more messed up. Now [!Log "#Variable#"] logs #Variable# as a literal string and not it's value.
And here is the code and an attached example skin (MiddleMouseUpAction will show the above behavior):

Code: Select all

[Rainmeter]
Update=-1
AccurateText=1

[Lua]
Measure=Script
ScriptFile=#@#Scripts\String.lua

[Variables]
String=Meter5
LMUA=([&Lua:Index('[#*CURRENTSECTION*]')]+[&Lua:Index('[#*CURRENTSECTION*]')])
RMUA=([&Lua:Index('[#*String*]')]+[&Lua:Index('[#*String*]')])

[Meter5]
Meter=Image
H=30
W=30
SolidColor=00ffff
DynamicVariables=1
LeftMouseUpAction=[!SetVariable Example "#LMUA#"][!Log "[#Example]"]
RightMouseUpAction=[!SetVariable Example "#RMUA#"][!Log "[#Example]"]
MiddleMouseUpAction=[!SetVariable Example "#RMUA#"][!Log "#Example#"]

Code: Select all

function Index(k)
    local a=string.gsub(k, '^%D+(%d+)$', '%1')
    a = tonumber(a)
    return a
end
Skin:
CURRENTSECTION_1.00.rmskin
Rainmeter version info:
Rainmeter 4.4.0.3493 beta (64-bit)
Language: English (1033)
Build time: 2021-06-29 5:26:27
Windows 10[/11 preview if it matters] Home Single Language 2009 64-bit (build 22000) - English (1033)
Path: C:\Program Files\Rainmeter\
SkinPath: C:\Users\sahoo\OneDrive\Documents\Rainmeter\Skins\
SettingsPath: C:\Users\sahoo\AppData\Roaming\Rainmeter\
IniFile: C:\Users\sahoo\AppData\Roaming\Rainmeter\Rainmeter.ini
You do not have the required permissions to view the files attached to this post.
Last edited by death.crafter on June 30th, 2021, 9:27 am, edited 1 time in total.
from the Realm of Death
My Current Desktop
User avatar
death.crafter
Posts: 501
Joined: April 24th, 2021, 8:13 pm

Re: [BUG?] in Multiple usage of #CURRENTSECTION#

Post by death.crafter »

This is too early to open a thread but look at this:
Screenshot 2021-06-30 120123.png
Rounded context menu appears only after first load of the app but then is overridden by default Rainmeter one. It's not a bug but it would be great if context menu adapted to windows theme and style.( I know it's not great in terms of cost - value )
You do not have the required permissions to view the files attached to this post.
from the Realm of Death
My Current Desktop
User avatar
Active Colors
Moderator
Posts: 807
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: [BUG?] in Multiple usage of #CURRENTSECTION#

Post by Active Colors »

death.crafter wrote: June 30th, 2021, 6:18 am Rainmeter version info:
Rainmeter 4.4.0.3493 beta (64-bit)
Language: English (1033)
Build time: 2021-06-29 5:26:27
Windows 10[/11 preview if it matters] Home Single Language 2009 64-bit (build 22000) - English (1033)
Path: C:\Program Files\Rainmeter\
First of all, the Windows version does not matter (at least I get the same behavior on Windows 7 SP1).


death.crafter wrote: June 30th, 2021, 6:18 am Skin:
CURRENTSECTION_1.00.rmskin
There is something going on with updating the variable. When RightMouseClickAction is triggered the log shows the right value of Example which is 10 in your skin, however, in the Skins tab of About window I don't see it declared. Maybe, because the nested variables are naturally dynamic, I suppose Rainmeter, dynamically, is able to log the value of [#Example] this way, even though I don't observe it declared in the About-Skins list of variables.

However! Your issue can be easily fixed once you, either, plug in [!Update] bang in the chain of bangs, or, set Update= to a positive integer. Then classic variable form #Example# will retrieve the "10" in the log.
User avatar
death.crafter
Posts: 501
Joined: April 24th, 2021, 8:13 pm

Re: [BUG?] in Multiple usage of #CURRENTSECTION#

Post by death.crafter »

Active Colors wrote: June 30th, 2021, 9:10 am However! Your issue can be easily fixed once you, either, plug in [!Update] bang in the chain of bangs, or, set Update= to a positive integer. Then classic variable form #Example# will retrieve the "10" in the log.
Ohh! I forgot to mention Update=-1. I guess it's not a bug then.
Anyway, did you check the real problem. The LeftMouseUpAction. It logs error for me. While RightMouseUpAction has the exact configuration and it logs right.
Screenshot 2021-06-30 145422.png
You do not have the required permissions to view the files attached to this post.
from the Realm of Death
My Current Desktop
User avatar
Active Colors
Moderator
Posts: 807
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: [BUG?] in Multiple usage of #CURRENTSECTION#

Post by Active Colors »

death.crafter wrote: June 30th, 2021, 9:25 am Ohh! I forgot to mention Update=-1. I guess it's not a bug then.
Anyway, did you check the real problem. The LeftMouseUpAction. It logs error for me. While RightMouseUpAction has the exact configuration and it logs right.

Screenshot 2021-06-30 145422.png
Wait a second. Have you seen this message from Yincognito here? https://forum.rainmeter.net/viewtopic.php?f=14&t=37775#p192611

I don't see your reply to that message.
User avatar
death.crafter
Posts: 501
Joined: April 24th, 2021, 8:13 pm

Re: [BUG?] in Multiple usage of #CURRENTSECTION#

Post by death.crafter »

Active Colors wrote: June 30th, 2021, 9:33 am Wait a second. Have you seen this message from Yincognito here? https://forum.rainmeter.net/viewtopic.php?f=14&t=37775#p192611

I don't see your reply to that message.
Yes I have seen it. And that works fine. But I am still getting errors when using Mouse actions. I don't exactly know why tho.

And I noticed it's not multiple CURRENTSECTIONs, single CURRENTSECTION doesn't work either.

When explicitly used with mouse actions.

Take this code for example. While RightMouseUpAction works right, Left doesn't. Let me change the topic of this thread.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Lua]
Measure=Script
ScriptFile=#@#Scripts\String.lua

[Variables]
String=Meter5
LMUA=([&Lua:Index('[#*CURRENTSECTION*]')]*6)
RMUA=([&Lua:Index('[#*String*]')]*6)

[Meter5]
Meter=Image
H=#LMUA#
W=30
SolidColor=00ffff
DynamicVariables=1
LeftMouseUpAction=[!SetVariable Example "#LMUA#"][!Log "[#Example]"]
RightMouseUpAction=[!SetVariable Example "#RMUA#"][!Log "[#Example]"]
from the Realm of Death
My Current Desktop
User avatar
Active Colors
Moderator
Posts: 807
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: [BUG?] in Multiple usage of #CURRENTSECTION#

Post by Active Colors »

death.crafter wrote: June 30th, 2021, 9:45 am Yes I have seen it. And that works fine. But I am still getting errors when using Mouse actions. I don't exactly know why tho.

And I noticed it's not multiple CURRENTSECTIONs, single CURRENTSECTION doesn't work either.

When explicitly used with mouse actions.

Take this code for example. While RightMouseUpAction works right, Left doesn't. Let me change the topic of this thread.
It reminds me that there was a problem with how bangs interpret escaped variables. I don't remember the exact thread though.


First of all, notice that Rainmeter in About-Skins window reports the [#*CURRENTSECTION*] without the asterisks. (check extra readings at the bottom)
Image 1.png

Then, for instance, if you have simply a variable Test=[#*CURRENTSECTION*], when you will try to [!Log "Test is [#Test]"] the [#Test] will show nothing.
2.PNG

HOWEVER, if you use [#Test] in a measure, it works.
3.PNG

Extra readings:
• Nesting confusion https://forum.rainmeter.net/viewtopic.php?f=5&p=161392#p161392
• Escaped variables https://forum.rainmeter.net/viewtopic.php?f=14&p=191846#p191846
• Nesting variables note in the documentation https://docs.rainmeter.net/manual/variables/nesting-variables/

Code:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Variables]
Test=[#*CURRENTSECTION*]

[5]
Measure=Calc
Formula=([#Test])
DynamicVariables=1

[Meter5]
Meter=Image
H=30
W=30
SolidColor=00ffff
MouseOverAction=[!Log "Test is [#Test]"][!Log "Measure 5 is [&5]"]
DynamicVariables=1
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 3647
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [BUG?] in Multiple usage of #CURRENTSECTION#

Post by Yincognito »

death.crafter wrote: June 30th, 2021, 9:45 am Yes I have seen it. And that works fine. But I am still getting errors when using Mouse actions. I don't exactly know why tho.
And I noticed it's not multiple CURRENTSECTIONs, single CURRENTSECTION doesn't work either.
When explicitly used with mouse actions.
Take this code for example. While RightMouseUpAction works right, Left doesn't. Let me change the topic of this thread.
Active Colors wrote: June 30th, 2021, 10:38 amIt reminds me that there was a problem with how bangs interpret escaped variables.
ActiveColors is spot on IMHO, here is the thread that illustrates another case of this problem and Brian's answers below. That is why I said this:
Yincognito wrote: June 28th, 2021, 10:46 amWell, I tested it and, apart from the #*CURRENTSECTION*# quirks that already existed before and you know about, it all seems fine from my end.
when verifying the new recent betas here. As far as I understood the matter, I'm not sure how this can be feasibly "fixed", since it's ingrained into how Rainmeter (and its parsing) works. It's not an easy horse to ride, this #CURRENTSECTION#...

Also, I'm for sure not the one to give lessons about forum threads and all that (since I too sometimes break this "rules", so to speak, plus, I don't want to seem, well, you understand how...), but in some cases, multiple threads on the matter can make understand the problem difficult for the devs. A good choice in such a case, IMHO, would have been to either link related threads so folks can see all there is to see about the issue, or just mention that problem in the respective thread. Just saying, I hope this is not misunderstood. ;-)

P.S. By the way, am I correct that the other issues reported by death.crafter here, apart from the #CURRENTSECTION# bang thing, are no longer problems? Just want to make sure of it.
User avatar
Active Colors
Moderator
Posts: 807
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: [BUG?] in Multiple usage of #CURRENTSECTION#

Post by Active Colors »

death.crafter,
Before this issue is fixed (if at all but hopefully will be) you can add one extra bang to MeterStyle and one extra "buffer" variable and have it working:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Variables]
Buffer=Meter5
LMUA=([&Lua:Index('[#*Buffer*]')])

[Lua]
Measure=Script
ScriptFile=#@#Scripts\String.lua

[StyleMeter]
X=5R
Y=r
H=30
W=30
SolidColor=00ffff
DynamicVariables=1
LeftMouseUpAction=[!SetVariable Buffer #CURRENTSECTION#][!SetOption #CURRENTSECTION# SolidColor 00ffff][!Update][!SetVariable Example "#LMUA#"][!Log "Example: [#Example] | LMUA: #LMUA#"][!Update]
LeftMouseDownAction=[!SetOption #CURRENTSECTION# SolidColor 0000ff][!Update]

[Meter1]
Meter=Image
MeterStyle=StyleMeter
X=0
Y=0

[Meter2]
Meter=Image
MeterStyle=StyleMeter

[Meter3]
Meter=Image
MeterStyle=StyleMeter

[Meter4]
Meter=Image
MeterStyle=StyleMeter

[Meter5]
Meter=Image
MeterStyle=StyleMeter

[Meter6]
Meter=Image
MeterStyle=StyleMeter

[Meter7]
Meter=Image
MeterStyle=StyleMeter
Click to animate:
GIF.gif
You do not have the required permissions to view the files attached to this post.