The issue is a common one when writing JSL.....you have special characters in your column names. So, for example, your column name could be
A+B
and what you are attempting to do, is to set a column property....in this case, Spec Limits. So if the command is directly written out, it would look like:
:A+B << Set Property( "Spec Limits", { LSL( 22 ), USL( 55 ), show limits( 1 ) } );
JSL will not like this, because it will interpret this as a column named "A" which you are adding the value from a variable name "B", and then applying the Set Property to it. JSL would just throw an error.
So, the solution is to use the :Name() function.
:Name("A+B") << Set Property( "Spec Limits", { LSL( 22 ), USL( 55 ), show limits( 1 ) } );
This will force JSL to interpret A+B as a column name. Now, to make this even more precise, if we add a pointer to a data table to the front of this, it will ensure that not only is it pointing to a specific column, it is pointing to a specific column in a specific data table
dt1 = data table("..........");
dt1:Name( "A+B" ) << Set Property( "Spec Limits", { LSL( 22 ), USL( 55 ), show limits( 1 ) } );
Now to your specific question:
( "dt1:Name(\!"" || Column( dt2, "ColumnName" )[i] || "\!")" )
It really needs to be looked at in a more complete form
Parse( "dt1:Name(\!"" || Column( dt2, "ColumnName" )[i] || "\!")" ) )
We need to always examine JSL, from the inside out. Therefore, lets say that
i = 2;
and that the value of the second row in data table dt2 for a variable named ColumnName is A+B.
Column( dt2, "ColumnName" )[i] = "A+B"
So now the JSL code is resolved to
Parse( "dt1:Name(\!"" || "A+B" || "\!")" ) )
The next operation is simply the contatenating of 3 strings into one string.
"dt1:Name(\!""
"A+B"
"\!")"
It may look like there are too many double quotes in string one and string 3. But in JSL, \! is an escape character, indicating that the character following it is to be treated differently. \!n is treated as a Linefeed character, and in our example, \!" is treated as an embedded double quote.
So once the concatenation is complete, the JSL looks like
Parse( "dt1:Name(\!"A+B\!")" ) )
The final step is the resulting action of the Parse() function. It will parse the string, and get it ready for execution. In our case it simply means that it will remove the outer double quotes, and resolve the \!" down to a simple double quote, leaving it with
dt1:Name("A+B")
This is the exact form of what is required as the syntax for referencing a column that has special characters in its name
dt1:Name( "A+B" ) << Set Property( "Spec Limits", { LSL( 22 ), USL( 55 ), show limits( 1 ) } );
I hope this helps
Jim