var=":Name\!"" || initCol || "\!"";I am trying to create a string variable which would contain the following: :Name("0")
I want to eventually extract data from a column named "0" which is why I'm trying to store this string into a variable. However the output gives me : var = ":Name(\!"0)\!"";
It seems like my escape characters aren't working properly... but without the escape characters I can't run my code at all. Can anyone please help? Could there possibly be a better way to index this column? The "initCol" will always contain a number, but it may not always be 0, which is why I need to store the number of interest in a variable before indexing the column.
Thanks!
You can also use special escape characters \[ and ]\ to allow any characters, including double quotes, in the string. I'm also using evalinsert for cleaner looking code:
initcol = "0";
var2 = evalinsert("\[:Name("^initcol^")]\");
write(var2);
From the log:
:Name("0")
This works for me
initCol = "0";
var = ":Name(\!"" || initCol || "\!")";
You can also use special escape characters \[ and ]\ to allow any characters, including double quotes, in the string. I'm also using evalinsert for cleaner looking code:
initcol = "0";
var2 = evalinsert("\[:Name("^initcol^")]\");
write(var2);
From the log:
:Name("0")
Could there be a setting I need to change in my jmp to get the codes mentioned to work? I have tried both solutions, and both of them result in the following output:
colsName = {":Name(\!"0\!")"};
colsName2 = {":Name(\!"0\!")"};
Here is the initial code:
colsName[count] = Eval Insert( "\[:Name("^test^")]\" );
colsName2[count] = ":Name(\!"" || test || "\!")";
Show( colsName );
Show( colsName2 );
colsName is a list of column names which is incremented. For now, count is equal to 1, and only one value (value 0) is trying to get written to the first element of the list, but I can't seem to get rid of the escape characters "\!".
JMP is working properly. When you use show or print the escape characters for double quotes are shown. If you use write() instead you'll see that the values are correct.
Yes, it is correct. The string is :Name("0").
You cannot use write with the list because it's not a string. Show includes the escape characters.
If you use write for a list element you'll see that the string is correct.
show(colsname, colsname2);
write("\!n" || colsName[1] || "\!n");
write(colsName2[1]);
From the log:
colsname = {":Name(\!"0\!")"};
colsname2 = {":Name(\!"0\!")"};
:Name("0")
:Name("0")