It is currently July 27th, 2021, 4:26 pm

[BUG?] in Multiple usage of #CURRENTSECTION#

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

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

Post by Yincognito »

Active Colors wrote: June 30th, 2021, 2:02 pmdeath.crafter,
Before this issue is fixed you can add one extra bang to MeterStyle and one extra "buffer" variable and have it working
Isn't that more or less the same as using the #CURRENTSECTION# literal or direct inline Lua syntax (without any buffer, custom variables, and such) though? :???:
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 »

Yincognito wrote: June 30th, 2021, 2:12 pm Isn't that more or less the same as using the #CURRENTSECTION# literal or direct inline Lua syntax (without any buffer, custom variables, and such) though? :???:
But then death.crafter could use direct Inline Lua from the beginning?
It is the same thing as Inline Lua in a bang but also it is the same thing as death.crafter wanted to have it in a variable.
(And this looks much tidy in my opinion :))
User avatar
Yincognito
Rainmeter Sage
Posts: 3650
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

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

Post by Yincognito »

Active Colors wrote: June 30th, 2021, 2:20 pm Same thing as Inline Lua but without the Inline Lua in the bang sequence. This looks much tidy in my opinion :)
If you say so... character counting says otherwise. But anyway, it was just something I noticed, don't mind my view on it. :thumbup:
P.S. One other difference is that inline syntax always works, from what I could see.
User avatar
death.crafter
Posts: 501
Joined: April 24th, 2021, 8:13 pm

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

Post by death.crafter »

Okay now the variable parsing thing is going out of hands:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Variables]
String=Meter5

Type=0

Text00=#*CURRENTSECTION*#
Text01=[#*CURRENTSECTION*]

Text10=#*String*#
Text11=[#*String*]

[MeterStyle]
Text=[#Text0[#Type]]
Y=5R
AntiAlias=1
FontSize=14
SolidColor=00ffff
DynamicVariables=1
LeftMouseUpAction=[!Log "[#Text0[#Type]]"]
RightMouseUpAction=[!SetVariable Type "(1 - #Type#)"][!Update][!Redraw]

[MeterStyle2]
Text=[#Text1[#Type]]
Y=5R
AntiAlias=1
FontSize=14
SolidColor=00ffff
DynamicVariables=1
LeftMouseUpAction=[!Log "[#Text1[#Type]]"]
RightMouseUpAction=[!SetVariable Type "(1 - #Type#)"][!Update][!Redraw]

[Meter1]
Meter=String
MeterStyle=MeterStyle
[Meter2]
Meter=String
MeterStyle=MeterStyle2
The normal variables are not even parsed. Right click to change between types.
Screenshot 2021-06-30 200849.png
Screenshot 2021-06-30 200830.png
You do not have the required permissions to view the files attached to this post.
Last edited by death.crafter on June 30th, 2021, 2:39 pm, 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 »

Active Colors wrote: June 30th, 2021, 2:20 pm But then death.crafter could use direct Inline Lua from the beginning?
It is the same thing as Inline Lua in a bang but also it is the same thing as death.crafter wanted to have it in a variable.
(And this looks much tidy in my opinion :))
Yincognito wrote: June 30th, 2021, 2:12 pm Isn't that more or less the same as using the #CURRENTSECTION# literal or direct inline Lua syntax (without any buffer, custom variables, and such) though? :???:
Thank you both for putting in your time and patience.
ActiveColors's way would be useful if I have a number of meter styles where a user wants to use a long long inline lua line as a mouse action. If you have a few and a rather short inline then you can go for literal implementation of the inline in MeterStyle.
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 »

Yincognito wrote: June 30th, 2021, 2:25 pm If you say so... character counting says otherwise. But anyway, it was just something I noticed, don't mind my view on it. :thumbup:
I understand you. For me, if you have multiple direct inline lua it will quickly become hard to read lines. It is quite subjective. For me this takes more time to work with something like this:
2.PNG

You can further make my code from the previous message simpler:

Code: Select all

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

[StyleMeter]
LeftMouseUpAction=[#!Buffer# #CURRENTSECTION#][!Update][!SetVariable Example "#LMUA#"][!Log "Example: [#Example] | LMUA: #LMUA#"]
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 3650
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, 2:32 pmOkay now the variable parsing thing is going out of hands...
It's the same issue as before: an escaped [#*CURRENTSECTION*] in a bang. Doesn't matter in how many nesting levels / variables you put it. It won't work.
User avatar
Yincognito
Rainmeter Sage
Posts: 3650
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

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

Post by Yincognito »

Active Colors wrote: June 30th, 2021, 2:53 pmBut if you have multiple direct inline lua it will quickly become hard to read lines. It is quite subjective though. For me this takes more time to work with something like this [...]
You can further make my code from the previous message simpler [...]
You're right. By the way, I might just use a tweaked version of your buffer variable to make the "old" direct #CURRENTSECTIONINDEX# work. Still weighing in which approach is easier.
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, 2:56 pm It's the same issue as before: an escaped [#*CURRENTSECTION*] in a bang. Doesn't matter in how many nesting levels / variables you put it. It won't work.
You think so? I beg to differ.

While with

Code: Select all

[Variables]
Text=[#*CURRENTSECTION*]

[String]
Text=[#Text]
it displays String but with

Code: Select all

[Variables]
Text=#*CURRENTSECTION*#

[String]
Text=[#Text]
it displays #CURRENTSECTION#.

And it's not used in a bang.
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 »

Yincognito wrote: June 30th, 2021, 2:25 pm P.S. One other difference is that inline syntax always works, from what I could see.
Ah yeah, fair enough, this is unbeatable :D

Off-topic:
Yincognito wrote: June 30th, 2021, 3:00 pm By the way, I might just use a tweaked version of your buffer variable to make the "old" direct #CURRENTSECTIONINDEX# work. Still weighing in which approach is easier.
First of all I am thinking to reduce it down to #INDEX# just like death.crafter has done to make it shorter and faster to read :D

The Buffer method is actually very similar to what I've done before with faking a bang https://forum.rainmeter.net/viewtopic.php?f=14&t=36895&start=30#p190370

I have been trying to weight which way to use as well. So far it is:

either Buffer method:

Code: Select all

[Variables]
Buffer=
INDEX=[&CSI:SectionIndex('[#*Buffer*]','last','(<x>)')]
!Buffer=!SetVariable Buffer

[Meter]
MouseOverAction=[#!Buffer# #CURRENTSECTION#][!Log #INDEX#]
or Split method:

Code: Select all

[Variables]
GET=[&CSI:SectionIndex('
INDEX=','last','(<x>)')]

[Meter]
MouseOverAction=[!Log "[#GET][#CURRENTSECTION][#INDEX]"]