<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: JSL error not enough arguments in access or evaluation of 'For' in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-error-not-enough-arguments-in-access-or-evaluation-of-For/m-p/265118#M51652</link>
    <description>&lt;P&gt;Hi Jeff,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you. That got rid of the error. However, I must have made a logical error. The code I had, erased all the columns in the data table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perhaps, I'm making a mistake with delete columns?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of "Remove from (col_list, i)", am I allowed to write the following?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dt&amp;lt;&amp;lt; delete columns(col_list[i]); ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure of the syntax. But my aim is to delete all columns which has "MTR" or "ProcessCon" etc in their column name.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 May 2020 21:27:01 GMT</pubDate>
    <dc:creator>shilpa</dc:creator>
    <dc:date>2020-05-07T21:27:01Z</dc:date>
    <item>
      <title>JSL error not enough arguments in access or evaluation of 'For'</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-error-not-enough-arguments-in-access-or-evaluation-of-For/m-p/265104#M51650</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am beginner in JSL scripting. I need help with the following error.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"not enough arguments in access or evaluation of 'For' "&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my code below, I am trying to delete columns that contain certain strings in their column name. I'm not sure where I am making the mistake.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
col_list = dt &amp;lt;&amp;lt; get column names(string);
for(i = 1; i&amp;gt;= N Items (col_list), i++,
If(
Contains(col_list[i], "MTR") | Contains(col_list[i], "AUTO") | Contains(col_list[i], "ProcessCon") | Contains(col_list[i], "Macro") | Contains(col_list[i], "OTH_SP") ),

Remove from(col_list, i)

)
);
dt &amp;lt;&amp;lt; delete columns( col_list );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please let me know. Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 20:40:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-error-not-enough-arguments-in-access-or-evaluation-of-For/m-p/265104#M51650</guid>
      <dc:creator>shilpa</dc:creator>
      <dc:date>2020-05-07T20:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: JSL error not enough arguments in access or evaluation of 'For'</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-error-not-enough-arguments-in-access-or-evaluation-of-For/m-p/265108#M51651</link>
      <description>&lt;P&gt;You've got a semi-colon (;) after the first argument instead of a comma (,).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You've also got an extra close parentheses.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It should be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
col_list = dt &amp;lt;&amp;lt; get column names( string );
For( i = 1, i &amp;gt;= N Items( col_list ), i++, 
//________^
//comma here, no semi-colon

	If(
		Contains( col_list[i], "MTR" ) | Contains( col_list[i], "AUTO" ) |
		Contains( col_list[i], "ProcessCon" ) | Contains( col_list[i], "Macro" ) |
		Contains( col_list[i], "OTH_SP" )
	), 

	Remove From( col_list, i )
//)
//don't need close parentheses above
);
dt &amp;lt;&amp;lt; delete columns( col_list );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 May 2020 20:45:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-error-not-enough-arguments-in-access-or-evaluation-of-For/m-p/265108#M51651</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2020-05-07T20:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: JSL error not enough arguments in access or evaluation of 'For'</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-error-not-enough-arguments-in-access-or-evaluation-of-For/m-p/265118#M51652</link>
      <description>&lt;P&gt;Hi Jeff,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you. That got rid of the error. However, I must have made a logical error. The code I had, erased all the columns in the data table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perhaps, I'm making a mistake with delete columns?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of "Remove from (col_list, i)", am I allowed to write the following?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dt&amp;lt;&amp;lt; delete columns(col_list[i]); ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure of the syntax. But my aim is to delete all columns which has "MTR" or "ProcessCon" etc in their column name.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 21:27:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-error-not-enough-arguments-in-access-or-evaluation-of-For/m-p/265118#M51652</guid>
      <dc:creator>shilpa</dc:creator>
      <dc:date>2020-05-07T21:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: JSL error not enough arguments in access or evaluation of 'For'</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-error-not-enough-arguments-in-access-or-evaluation-of-For/m-p/265126#M51654</link>
      <description>&lt;P&gt;I was able to get around the issue and below code worked for me to delete columns based on column name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Clear Log();

dt = Current Data Table();
col_list = dt &amp;lt;&amp;lt; get column names;
For( c = N Cols( dt ), c &amp;gt;= 1, c--,
	If(
		Contains( col_list[c], "MTR" ) | Contains( col_list[c], "AUTO" ) | Contains( col_list[c], "ProcessCon" )
		 | Contains( col_list[c], "Macro" ),
		dt &amp;lt;&amp;lt; deleteColumn( c )
	);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2020 11:37:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-error-not-enough-arguments-in-access-or-evaluation-of-For/m-p/265126#M51654</guid>
      <dc:creator>shilpa</dc:creator>
      <dc:date>2020-05-08T11:37:30Z</dc:date>
    </item>
  </channel>
</rss>

