<?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: JMP12 vs JMP14 close command while saving in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JMP12-vs-JMP14-close-command-while-saving/m-p/554356#M76904</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;close(data table ("ABC"),  save("\C:\Temp\ABC.csv") );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 10 Oct 2022 12:59:25 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2022-10-10T12:59:25Z</dc:date>
    <item>
      <title>JMP12 vs JMP14 close command while saving</title>
      <link>https://community.jmp.com/t5/Discussions/JMP12-vs-JMP14-close-command-while-saving/m-p/554349#M76902</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've recently moved to JMP14 and have some scripts that stop working due to "invalid argument in access or evaluation of 'Close'".&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically in JMP12 if I wanted to close table ABC and save it as a csv file, I'd use the following command:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;close(data table ("ABC") &amp;lt;&amp;lt; save("\C:\Temp\ABC.csv"));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In JMP14, I cannot do this anymore. Does anyone know what would be the equivalent to this command in JMP14 (without having to save it with 1 command and close it with another).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance, Eliav.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 15:59:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP12-vs-JMP14-close-command-while-saving/m-p/554349#M76902</guid>
      <dc:creator>godfeatha</dc:creator>
      <dc:date>2023-06-09T15:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: JMP12 vs JMP14 close command while saving</title>
      <link>https://community.jmp.com/t5/Discussions/JMP12-vs-JMP14-close-command-while-saving/m-p/554356#M76904</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;close(data table ("ABC"),  save("\C:\Temp\ABC.csv") );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Oct 2022 12:59:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP12-vs-JMP14-close-command-while-saving/m-p/554356#M76904</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-10-10T12:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: JMP12 vs JMP14 close command while saving</title>
      <link>https://community.jmp.com/t5/Discussions/JMP12-vs-JMP14-close-command-while-saving/m-p/554487#M76912</link>
      <description>&lt;P&gt;Jim's answer is correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, what changed? JMP 13 or 14 added a return code to the &amp;lt;&amp;lt;save message.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = open("$sample_data/big class.jmp");
x = dt&amp;lt;&amp;lt;save("$desktop/big class.jmp");
show(x); // 1&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The C++ developer decides to return a value (like 1 for &amp;lt;&amp;lt;save in JMP 14), or not, for each message. If no value is returned&amp;nbsp;(like in JMP 12) then the OBJ is returned. I don't like that it works that way, because it makes it hard to fix the language later, as you've discovered. Adding a return code to tell if the save succeeded caused your JSL to fail because you depended on the default behavior that returned the data table object from &amp;lt;&amp;lt;save.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyone still reading: writing JSL that chains more than one method and checks for the result is also a potential problem. Don't use chaining, and don't depend on the default behavior to help future-proof your JSL:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$sample_data/big class.jmp" );
// prefer to send messages one at a time. Three messages:&lt;BR /&gt;
x = dt &amp;lt;&amp;lt; getname;
Write( Eval Insert( "\!ngetname ^x^" ) ); // big class

x = dt &amp;lt;&amp;lt; save( "$desktop/big class.jmp" );
Write( Eval Insert( "\!nsave ^x^" ) ); // 1

x = dt &amp;lt;&amp;lt; end data update;
Write( Eval Insert( "\!nend data update ^x^ ^x&amp;lt;&amp;lt;getname^" ) ); // Scriptable[] (this is the default, dt is copied into x)

// don't do this, can you guess what x will be? same three messages...chained together
x = dt &amp;lt;&amp;lt; getname &amp;lt;&amp;lt; save( "$desktop/big class.jmp" ) &amp;lt;&amp;lt; end data update;
Write( Eval Insert( "\!nWhat will the answer be? ^x^" ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(I don't have JMP before 14, but I think this will be correct...)&lt;/P&gt;
&lt;P&gt;The answer to the chained question where &amp;lt;&amp;lt; is used three times will depend on the version of JMP. The &amp;lt;&amp;lt;getname will set a answer in JMP 12 and 14. In 14, the &amp;lt;&amp;lt;save will overwrite the answer. The &amp;lt;&amp;lt;EndDataUpdate uses the default behavior, but that only applies if there is no other answer. Confused? Don't chain.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 15:33:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP12-vs-JMP14-close-command-while-saving/m-p/554487#M76912</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2022-10-10T15:33:13Z</dc:date>
    </item>
  </channel>
</rss>

