<?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: JMP 13 Using Loc() with a list - changed behaviour? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JMP-13-Using-Loc-with-a-list-changed-behaviour/m-p/42781#M24800</link>
    <description>&lt;P&gt;This might be helpful: &lt;A href="https://community.jmp.com/t5/Discussions/JSL-Matrix-List-Programming-Change-for-JMP-13/m-p/18784" target="_blank"&gt;https://community.jmp.com/t5/Discussions/JSL-Matrix-List-Programming-Change-for-JMP-13/m-p/18784&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Aug 2017 14:33:06 GMT</pubDate>
    <dc:creator>Justin_Chilton</dc:creator>
    <dc:date>2017-08-02T14:33:06Z</dc:date>
    <item>
      <title>JMP 13 Using Loc() with a list - changed behaviour?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-13-Using-Loc-with-a-list-changed-behaviour/m-p/42778#M24797</link>
      <description>&lt;P&gt;I have just upgraded to JMP 13 and it has made many custom scripts stop working. I have traced the problem to a change in how lists handle the result from a loc query. The code below used to return "pear" in JMP 12 but now returns {"pear"}.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;mylist = {"apple","pear"};
mychoice = "pear";

showchoice = mylist[loc(mylist, mychoice)];&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I was using the list[loc()] syntax to&amp;nbsp;create&amp;nbsp;SQL comma separated strings to execute stored procedures.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The new behaviour is logical if unexpected. Regrettably Loc() still won't take a list argument as the look up value - that would have been a beneficial outcome. How would you recommend to&amp;nbsp;get the desired result:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;convert the Loc() result to a number?&lt;/LI&gt;&lt;LI&gt;replace showchoice with showchoice[1] in my code?&lt;/LI&gt;&lt;LI&gt;other?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I could convert my list of choice(s) to a string and strip out the { &amp;amp; } &amp;amp; \!". This will not always work as the text list I show the user is not always the same as the list from which the corresponding key is picked for the SQL request.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 14:25:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-13-Using-Loc-with-a-list-changed-behaviour/m-p/42778#M24797</guid>
      <dc:creator>stephen_pearson</dc:creator>
      <dc:date>2017-08-02T14:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: JMP 13 Using Loc() with a list - changed behaviour?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-13-Using-Loc-with-a-list-changed-behaviour/m-p/42779#M24798</link>
      <description>&lt;P&gt;I think that &lt;STRONG&gt;Loc()&lt;/STRONG&gt; is supposed to take a matrix and return the location of true elements (non-zero).&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Contains( list, item)&lt;/STRONG&gt; works with lists and returns the location of the target item.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 14:28:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-13-Using-Loc-with-a-list-changed-behaviour/m-p/42779#M24798</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2017-08-02T14:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: JMP 13 Using Loc() with a list - changed behaviour?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-13-Using-Loc-with-a-list-changed-behaviour/m-p/42781#M24800</link>
      <description>&lt;P&gt;This might be helpful: &lt;A href="https://community.jmp.com/t5/Discussions/JSL-Matrix-List-Programming-Change-for-JMP-13/m-p/18784" target="_blank"&gt;https://community.jmp.com/t5/Discussions/JSL-Matrix-List-Programming-Change-for-JMP-13/m-p/18784&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 14:33:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-13-Using-Loc-with-a-list-changed-behaviour/m-p/42781#M24800</guid>
      <dc:creator>Justin_Chilton</dc:creator>
      <dc:date>2017-08-02T14:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: JMP 13 Using Loc() with a list - changed behaviour?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-13-Using-Loc-with-a-list-changed-behaviour/m-p/42782#M24801</link>
      <description>&lt;P&gt;This is abit like overfitting with predictive models. Your code is tuned to how JMP actually works as opposed to how it ought to work. &amp;nbsp;Which is fine, until the next release :)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 14:38:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-13-Using-Loc-with-a-list-changed-behaviour/m-p/42782#M24801</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2017-08-02T14:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: JMP 13 Using Loc() with a list - changed behaviour?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-13-Using-Loc-with-a-list-changed-behaviour/m-p/42783#M24802</link>
      <description>Replacing Loc() with Contains() fixed the issue. Thanks. I guess I had been doing too much Matrix manipulation when I wrote this section of code.</description>
      <pubDate>Wed, 02 Aug 2017 14:52:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-13-Using-Loc-with-a-list-changed-behaviour/m-p/42783#M24802</guid>
      <dc:creator>stephen_pearson</dc:creator>
      <dc:date>2017-08-02T14:52:30Z</dc:date>
    </item>
  </channel>
</rss>

