<?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: Returning either list of rows or NULL in my function. How do I work with multiple return values in a jsl-script? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Returning-either-list-of-rows-or-NULL-in-my-function-How-do-I/m-p/19850#M18094</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You!&lt;/P&gt;&lt;P&gt;This solved my problem. &lt;SPAN __jive_emoticon_name="check" __jive_macro_name="emoticon" class="jive_macro_emoticon jive_emote jive_macro" src="https://community.jmp.com/7.0.4.3b79b96/images/emoticons/check.png"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Aug 2016 07:11:24 GMT</pubDate>
    <dc:creator>martinschmid</dc:creator>
    <dc:date>2016-08-11T07:11:24Z</dc:date>
    <item>
      <title>Returning either list of rows or NULL in my function. How do I work with multiple return values in a jsl-script?</title>
      <link>https://community.jmp.com/t5/Discussions/Returning-either-list-of-rows-or-NULL-in-my-function-How-do-I/m-p/19848#M18092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess my problem can be solved pretty easily.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to write a function, that either returns a list of row-numbers or NULL in dependency of an if-clause inside my function.&lt;/P&gt;&lt;P&gt;How can I handle multiple return values and how can I return NULL?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My function should look somehow like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myFunction = Function( {...}, {...},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; list = { ... };&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(...)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;then &lt;/STRONG&gt;return list&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else return NULL&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have already found this tutorial:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.jmp.com/message/25472#25472" title="https://community.jmp.com/message/25472#25472"&gt;https://community.jmp.com/message/25472#25472&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but what if I have multiple return values, like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;return1=...&lt;/P&gt;&lt;P&gt;return2=...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how do I handle these, and how do I return NULL then?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2016 13:32:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Returning-either-list-of-rows-or-NULL-in-my-function-How-do-I/m-p/19848#M18092</guid>
      <dc:creator>martinschmid</dc:creator>
      <dc:date>2016-08-10T13:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Returning either list of rows or NULL in my function. How do I work with multiple return values in a jsl-script?</title>
      <link>https://community.jmp.com/t5/Discussions/Returning-either-list-of-rows-or-NULL-in-my-function-How-do-I/m-p/19849#M18093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Might be safer to return a 0-element list if your if clause doesn't find any row numbers.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;myFunction &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #0000dd;"&gt;Function&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10.0pt; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal;"&gt;...&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;}&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal;"&gt;...&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;}&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_list &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;{}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #0000dd;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;(&lt;/STRONG&gt;my_test&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_list &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt; &lt;STRONG style="color: teal; font-size: 10.0pt; font-family: 'Courier New';"&gt;2&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt; &lt;STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal;"&gt;3&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;}&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green;"&gt;// Test passed, return values&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_list&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: black; font-size: 10.0pt; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;one_list &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; myFunction&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal;"&gt;...&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #0000dd;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #0000dd;"&gt;nitems&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10.0pt; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;one_list&lt;STRONG&gt;)&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;&amp;gt;&lt;/SPAN&gt; &lt;STRONG style="color: teal; font-size: 10.0pt; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green;"&gt;// handle items in the list&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: black; font-size: 10.0pt; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2016 14:04:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Returning-either-list-of-rows-or-NULL-in-my-function-How-do-I/m-p/19849#M18093</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2016-08-10T14:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Returning either list of rows or NULL in my function. How do I work with multiple return values in a jsl-script?</title>
      <link>https://community.jmp.com/t5/Discussions/Returning-either-list-of-rows-or-NULL-in-my-function-How-do-I/m-p/19850#M18094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You!&lt;/P&gt;&lt;P&gt;This solved my problem. &lt;SPAN __jive_emoticon_name="check" __jive_macro_name="emoticon" class="jive_macro_emoticon jive_emote jive_macro" src="https://community.jmp.com/7.0.4.3b79b96/images/emoticons/check.png"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2016 07:11:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Returning-either-list-of-rows-or-NULL-in-my-function-How-do-I/m-p/19850#M18094</guid>
      <dc:creator>martinschmid</dc:creator>
      <dc:date>2016-08-11T07:11:24Z</dc:date>
    </item>
  </channel>
</rss>

