BookmarkSubscribeSubscribe to RSS Feed

RE: Invalid Row Number Error

Jaz

Frequent Contributor

Joined:

Jun 11, 2018

Hi, 

 

I was just wondering about this error I got when I ran my script:

Invalid Row Number{92} in access or evaluation of 'Subscript' , colInstructions[q]

The value of q never reaches 92 so I'm not sure where that number came from, or is 92 in relation to something else? Just for some background information I created a new column to which I'm assigning the value of a cell from another data table (colInstructions[q]). 

 

Any help would be appreciated. 

 

3 REPLIES
pmroz

Super User

Joined:

Jun 23, 2011

Make sure the cell is fully qualified with the table name and column name.  If both tables have the same column name you might get this error, i.e. one table doesn't have 92 rows.

dt1 = data table("Table 1");
dt2 = data table("Table 2");

column(dt2, "Instructions")[92] = column(dt1, "Instructions")[14];
Jaz

Frequent Contributor

Joined:

Jun 11, 2018

Ok thanks, 

 

Both tables don't have the same columns but I have another question related to creating new columns: do you have to specify how many rows the column has when you create a new column and how would you do this? 

 

Thanks again. 

 

Highlighted
txnelson

Super User

Joined:

Jun 22, 2012

If you add a new column to an existing data table, the column will have the same number of rows as the data table the new column is being added to.   JMP data tables do not have different number of rows for different columns.  They may have missing values or blank values for character columns, but all columns will have the same number of rows.  If you need to add additional rows, you can use "Add Rows()" function.  See:

     Help==>Scripting Index==>Data Table==>Add Rows

Jim