kyriakos876 wrote: ↑October 20th, 2018, 11:13 am
Hello, I didn't want to open another thread because it's similar to the above post but escaping doesn't do the trick this time around.
Here's my issue...
What's up? Is it parsing from right to left, so because there's no Name variable it can't process it?
Obviously neither really works, since #Name# is not defined.
There are some known issues with nesting #CurrentSection# with other variables, it has to do with the order that things are parsed in, as you note. I'm not clear on the details, perhaps Brian can weigh in at some point.
jsmorley wrote: ↑October 20th, 2018, 1:25 pm
Obviously neither really works, since #Name# is not defined.
There are some known issues with nesting #CurrentSection# with other variables, it has to do with the order that things are parsed in, as you note. I'm not clear on the details, perhaps Brian can weigh in at some point.
The second one works.... Notice that I changed the name of the variable as well. So I suppose it's parsed from inside to outise...
jsmorley wrote: ↑October 20th, 2018, 1:48 pm
It only works by accident. Since #Name# is not defined, it is treated as text, almost as if you defined Name=Name in [Variables].
Alright... I'll work with the accident then until there is more light in the tunnel
Nested variables are parsed "inside to outside", so that is why your second example works, but the first one does not.
Example 1: #Name doesn't exist and no replacement is made, so the final outer variable becomes #CurrentSection[#Name] which obviously will not work.
Example 2: #CurrentSection get replaced with "Shortcut1" which is then appended to "Name" making [#NameShortcut1] which then gets replaced with "Something".
It's a little tricky to wrap your head around, but this example is one of the driving forces of nested variables.
Brian wrote: ↑October 20th, 2018, 2:58 pm
Nested variables are parsed "inside to outside", so that is why your second example works, but the first one does not.
Example 1: #Name doesn't exist and no replacement is made, so the final outer variable becomes #CurrentSection[#Name] which obviously will not work.
Example 2: #CurrentSection get replaced with "Shortcut1" which is then appended to "Name" making [#NameShortcut1] which then gets replaced with "Something".
It's a little tricky to wrap your head around, but this example is one of the driving forces of nested variables.
-Brian
Oh okay... so my assumption above
kyriakos876 wrote: ↑October 20th, 2018, 1:46 pm
The second one works.... Notice that I changed the name of the variable as well. So I suppose it's parsed from inside to outise...
And I didn't think that there were more syntax options... Maybe I should have because it says "Examples" and not "Nothing else than that"
Thanks for your solution!
It's all predicated on the fact that nested variables are parsed from the "inside out". It will start with the most inside variable, resolve it, then start working out. Anything that isn't a valid variable is treated as "text". At the end, the entire thing is evaluated to see if it matches an existing variable name, and if so, the value is returned.