You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*** Variables ***${X} Y # Normal assignment. Creates ${X} with value Y.${${X}} Z # Assignment based on another variable. Creates ${Y} with value Z.
This is likely not that widely needed feature, but we plan to support this approach with the new VAR syntax (#3761) and we also have an issue about supporting it when creating variables based on keyword return values (#4545). Especially the VAR usage will be very close to what proposed above and supporting the same in the Variables section is good for consistency.
VAR ${X} Y # Normal assignment. Creates ${X} with value Y.
VAR ${${X}} Z # Assignment based on another variable. Creates ${Y} with value Z.
Implementation shares most of the same code that ´VAR` uses, so the extra effort is really small.
The text was updated successfully, but these errors were encountered:
Now that we add this support to Variables, VAR and to keyword return values, we could consider making the nested syntax valid everywhere where variables are created. That would allow usages like this:
FOR ${${x}} IN a b c
EXCEPT AS ${${x}}
[Arguments] ${${x}}
I don't see any use case for any of these and the latest one would be rather confusing and make resolving named argument usages complicated. Consistently supporting same syntax everywhere would have benefits, but I don't believe they are big enough here. Anyway, we can return to this in the future if needed.
pekkaklarck
changed the title
Support nested variable assignment in Variables section
Support creating variable name based on another variable like ${${VAR}} in Variables section
Nov 7, 2023
Example:
This is likely not that widely needed feature, but we plan to support this approach with the new
VAR
syntax (#3761) and we also have an issue about supporting it when creating variables based on keyword return values (#4545). Especially theVAR
usage will be very close to what proposed above and supporting the same in the Variables section is good for consistency.Implementation shares most of the same code that ´VAR` uses, so the extra effort is really small.
The text was updated successfully, but these errors were encountered: