BookmarkSubscribeRSS Feed

Formula bug


Community Member


Mar 27, 2017

Hi I am getting error while I run this code.


Is there any mistake i am overlooking ?


 //Remove brackets in All Column names
dt1 << deselect all();
wait (0.5);
//int i = 0;
For (int j = 7, j <= 86, j ++,
col = Column (j);
colname = "I" || Char(j-6) || "_nA";
col << Set Name(colname);

Community Manager


Jun 23, 2011

It appears that you're trying to declare a variable type before your variable j by prefacing it with int.


There are a couple of issues with this:


  1. JSL doesn't require (or support) declaring a variable type.
  2. Spaces are ignored in JSL, so in your code your loop counter variable is actually "int j". So, when you refer to "j" in the comparison it is undefined.

Just remove the "int" and your code should not produce the error.