Posted by member 37809 on 2004-08-11 13:50:44 link
I'm still curious as to why you would need more than two levels of var expansions so often to make it a generic omnipotent bang.
i.e. from your other post:
You plan to have variables for all the possible combinations, per tmp ? And then the same for other things? I'd like to dismiss it as a bad choice in design, but maybe you're on to something powerful here.
I'm just saying this all seems like it's geared to work for the "proper parameters" you present. I think you would need to use a stack to be able to expand all possible formats of nested variables. I don't know if you would want to pursue making that in current scripting while waiting for better days, those without multiple escape code paralysis.
Here's something untested of lesser ideal anyhow:
Then on a case-by-case basis you could do things like this:
Sometimes I think I abuse varnames :S
i.e. from your other post:
!eval !varSet (tmp)BoxImageLeftEdge "(((tmp)style)_((tmp)thick)_edge_((tmp)grip)_left)"
You plan to have variables for all the possible combinations, per tmp ? And then the same for other things? I'd like to dismiss it as a bad choice in design, but maybe you're on to something powerful here.
I'm just saying this all seems like it's geared to work for the "proper parameters" you present. I think you would need to use a stack to be able to expand all possible formats of nested variables. I don't know if you would want to pursue making that in current scripting while waiting for better days, those without multiple escape code paralysis.
Here's something untested of lesser ideal anyhow:
*script bang !expand ;<varnameForResult> <varnameToExpand>
*script exec !exec !varset %{\1} "%{P}{%{\2}}" ; don't remember if extra exec necessary
*script ~bang
*script exec !exec !varset %{\1} "%{P}{%{\2}}" ; don't remember if extra exec necessary
*script ~bang
Then on a case-by-case basis you could do things like this:
!varset q edge
!varset r bottom
!expand s %{test}_style
!expand t %{test}_thick
!expand g %{test}_grip
!expand tmp %{s}_%{t}_%{q}_%{g}_%{r}
; or worse, if it even works:
!varset tmp {%{P}{%{test}_style}_%{P}{%{test}_thick}_%{q}_%{P}{%{test}_grip}_%{r}}
!varset tmp %%{tmp}
!varset r bottom
!expand s %{test}_style
!expand t %{test}_thick
!expand g %{test}_grip
!expand tmp %{s}_%{t}_%{q}_%{g}_%{r}
; or worse, if it even works:
!varset tmp {%{P}{%{test}_style}_%{P}{%{test}_thick}_%{q}_%{P}{%{test}_grip}_%{r}}
!varset tmp %%{tmp}
Sometimes I think I abuse varnames :S