cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
CrownofTears
Level II

I cant move newly created columns to specific locations

I cant make my code work. I am trying to move some newly created columns to specific locations but I get the next error:

 

"Unrecognized key word"

 

Do you guys have any ideas of whats wrong here?

 

ColDelta=(ColNum-2)/2;
ColStart=4;

For(k=1, k<=ColDelta, k++,
	
	TabData << Move Selected Columns(
		Column (ColNum+k), after(Column(ColStart))
	);
	ColStart=ColStart+3;
	
	
);
1 ACCEPTED SOLUTION

Accepted Solutions
mmarchandTSI
Level V

Re: I cant move newly created columns to specific locations

Try adding curly braces, like this:

 

ColDelta=(ColNum-2)/2;
ColStart=4;

For(k=1, k<=ColDelta, k++,
	
	TabData << Move Selected Columns(
		{Column (ColNum+k)}, after(Column(ColStart))
	);
	ColStart=ColStart+3;
	
	
);

View solution in original post

4 REPLIES 4
mmarchandTSI
Level V

Re: I cant move newly created columns to specific locations

Try adding curly braces, like this:

 

ColDelta=(ColNum-2)/2;
ColStart=4;

For(k=1, k<=ColDelta, k++,
	
	TabData << Move Selected Columns(
		{Column (ColNum+k)}, after(Column(ColStart))
	);
	ColStart=ColStart+3;
	
	
);
CrownofTears
Level II

Re: I cant move newly created columns to specific locations

Perfect! It worked perfectly. Do you have an explanation on why or when I should use the curly braces?

mmarchandTSI
Level V

Re: I cant move newly created columns to specific locations

Well, kind of.  I tried them, because it can take a list of columns.  In this case, it seems to want even a single column in list format.

jthi
Super User

Re: I cant move newly created columns to specific locations

You might find syntax information sometimes from JMP Help Scripting Guide > Data Tables > Work with Columns > Rearrange and Move Columns or JSL Syntax Reference (can be found from JMP Documentation page)

jthi_0-1692023185552.png

 

-Jarmo