I cant find a practical way to extend a muti-variable assignment across multiple
code line.
This is needed when there are many values to assign (that cant fit on one line) or
when assignment need to be done in a loop or in in separate statements.
I think it wouldn't be a problem to add the ability to continue a #set command in the next line, which would mean having a #set command in multiple lines.
For extension of a variable:
I would also suggest the first option given. You recall correctly, I tried these things in XVCL.
Will result a multi-variable having values: "Value1", "Value2", "Value3", "Value4", "Value5", "Value6", "Value7", "Value8"
However we have to forbid extension of a variable, which is a control variable of any currently processed loop, since that would be unsafe and could lead to errors.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I cant find a practical way to extend a muti-variable assignment across multiple
code line.
This is needed when there are many values to assign (that cant fit on one line) or
when assignment need to be done in a loop or in in separate statements.
A few possible approaches are:
#set myMultiVariable = "Value1", "Value2", "Value3", "Value4"
#set myMultiVariable = ?@myMultiVariable?, "Value5", "Value6", "Value7", "Value8"
or
#set myMultiVariable = "Value1", "Value2", "Value3", "Value4"
#set myMultiVariable = myMultiVariable + "Value5", "Value6", "Value7", "Value8"
or
#set myMultiVariable = "Value1", "Value2", "Value3", "Value4",
#set myMultiVariable += "Value5", "Value6", "Value7", "Value8"
If I recall correct, I used the first of the above when using XVCL.
Dear Ulf,
I think it wouldn't be a problem to add the ability to continue a #set command in the next line, which would mean having a #set command in multiple lines.
For extension of a variable:
I would also suggest the first option given. You recall correctly, I tried these things in XVCL.
So
Will result a multi-variable having values: "Value1", "Value2", "Value3", "Value4", "Value5", "Value6", "Value7", "Value8"
However we have to forbid extension of a variable, which is a control variable of any currently processed loop, since that would be unsafe and could lead to errors.