I will be quoting you here instead.
Yes, have considered the first point you made before opening an different thread.
When we use [#*CURRENTSECTION*], the variables becomes [#CURRENTSECTION], but that is also the value used when the variable is used in the bangs. For example, [!Log "#Variable#"] becomes [!Log "[#CURRENTSECTION]"] to the parser.
The second thread you linked is my very own thread, that was when I did not understand the parsing method, but now that I do, I can say for sure that it has nothing to do with that. In that thread I wanted the variables "not to be parsed".
So let's consider the case.
When we use:
Code: Select all
[Variables]
CrrntSection1=[#CURRENTSECTION]
CrrntSection2=[#*CURRENTSECTION*]
CrrntSection3=[#**CURRENTSECTION**]
CrrntSection4=[#***CURRENTSECTION***]
[Meter]
...
LeftMouseUpAction=[!Log "#CrrntSection2#"]
Let's iterate through the CrrntSection{N} variables and see the expected and logged results:
- Expected Value=Variables, Real Value=Variables
- Expected Value=Meter, Real Value=' '
- Expected Value=Meter, Real Value=' '
- Expected Value=[#CURRENTSECTION], Real Value=[#CURRENTSECTION]
Well that's the results based on how the parsing of bangs take place.
But quoting Brian here,
Brian wrote: ↑April 23rd, 2021, 6:33 am
For example, in your case above, when the IfConditions actions are read, the
#CURRENTSECTIONINDEX# variable is replaced with
[&Script:SectionIndex('[#CURRENTSECTION]','last','(<x>)')] (note the
*'s were removed in this step). Normally, the current section special processing would kick in and parse the [#CURRENTSECTION] variable here, but that does not happen since the action only re-evaluates section/nested variables when the action is executed. By that time, section tracking is lost and nothing is retrieved. This particular case seems to be related to variables referencing other variables containing the current section variable.
Unfortunately, this current section issue has been around since we introduced the variable. Fixing it for all the special cases has been a challenge.
-Brian
I guess this problem is a pain ita. So I would not prod it further. I just wanted to make my point clearer.