<?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 &amp;gt; JSL &amp;gt; How to Pass Arguments to Add-In included my own script? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JMP-gt-JSL-gt-How-to-Pass-Arguments-to-Add-In-included-my-own/m-p/448752#M69556</link>
    <description>&lt;P&gt;I installed the addin from &lt;A href="https://community.jmp.com/t5/JMP-Add-Ins/False-Discovery-Rate-PValue/ta-p/21353" target="_blank" rel="noopener"&gt;here&lt;/A&gt; and looked at the code. I would most likely rewrite it and use functions, but you should be able to use the New Window that the addin creates with something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

//This will immediately launch New Window with reference fdrDlg
Include("$ADDIN_HOME(com.sas.sall.fdrpvalue)/falseDiscoveryPValue.jsl");

dt = Open("$SAMPLE_DATA/Big Class.jmp");
colListLabel &amp;lt;&amp;lt; Set Items({"age", "sex"}); //Label Columns
colListPVal &amp;lt;&amp;lt; Set Items({"height"}); //PValue Column

//ok button doesn't have direct reference, so we can look for it with XPath for example
ok_btn = (fdrDlg &amp;lt;&amp;lt; XPath("//ButtonBox[@title='OK']"))[1];

//to launch we can press ok_btn
ok_btn &amp;lt;&amp;lt; Click;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 03 Jan 2022 22:13:54 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2022-01-03T22:13:54Z</dc:date>
    <item>
      <title>JMP &gt; JSL &gt; How to Pass Arguments to Add-In included my own script?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-gt-JSL-gt-How-to-Pass-Arguments-to-Add-In-included-my-own/m-p/448733#M69555</link>
      <description>&lt;P&gt;Hi JMP Community,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am an avid user of John Sall's FDR calculation Add-In (&lt;SPAN&gt;com.sas.sall.fdrpvalue.jmpaddin) in analyzing large biomarker data.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;While the manual input of data in this Add-In is straightforward, I have not figured out how to pass arguments from my JSL scripts into this tool.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I know that I have to use the Include ("[Add-in]") command to enable the use of the Add-In in my scripts, but how do I point to specific columns generated by my script into the Add-In?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you for your help.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;TS&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 18:08:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-gt-JSL-gt-How-to-Pass-Arguments-to-Add-In-included-my-own/m-p/448733#M69555</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2023-06-09T18:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: JMP &gt; JSL &gt; How to Pass Arguments to Add-In included my own script?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-gt-JSL-gt-How-to-Pass-Arguments-to-Add-In-included-my-own/m-p/448752#M69556</link>
      <description>&lt;P&gt;I installed the addin from &lt;A href="https://community.jmp.com/t5/JMP-Add-Ins/False-Discovery-Rate-PValue/ta-p/21353" target="_blank" rel="noopener"&gt;here&lt;/A&gt; and looked at the code. I would most likely rewrite it and use functions, but you should be able to use the New Window that the addin creates with something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

//This will immediately launch New Window with reference fdrDlg
Include("$ADDIN_HOME(com.sas.sall.fdrpvalue)/falseDiscoveryPValue.jsl");

dt = Open("$SAMPLE_DATA/Big Class.jmp");
colListLabel &amp;lt;&amp;lt; Set Items({"age", "sex"}); //Label Columns
colListPVal &amp;lt;&amp;lt; Set Items({"height"}); //PValue Column

//ok button doesn't have direct reference, so we can look for it with XPath for example
ok_btn = (fdrDlg &amp;lt;&amp;lt; XPath("//ButtonBox[@title='OK']"))[1];

//to launch we can press ok_btn
ok_btn &amp;lt;&amp;lt; Click;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Jan 2022 22:13:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-gt-JSL-gt-How-to-Pass-Arguments-to-Add-In-included-my-own/m-p/448752#M69556</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-01-03T22:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: JMP &gt; JSL &gt; How to Pass Arguments to Add-In included my own script?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-gt-JSL-gt-How-to-Pass-Arguments-to-Add-In-included-my-own/m-p/448792#M69560</link>
      <description>&lt;P&gt;Hi JMP Community,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, thanks to&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;for a quick and efficient solution.&lt;/P&gt;
&lt;P&gt;Just for completeness, I used a crude alternative option where I created a function out of the core elements of the FDR JSL script (see below). I then called this function in my script.&lt;/P&gt;
&lt;P&gt;IMPORTANTLY: the core code used in this function was created by John Sall.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);

fdr = Function ({dtf, pvalCol},

	pvalues = pvalCol&amp;lt;&amp;lt;Get Values;
	if (min(pvalues)&amp;lt;0 | max(pvalues)&amp;gt;1,dialog("PValues must be between 0 and 1");throw());

	index = rankIndex(pvalues);	// removes missing values
	n = nrow(index);

	ordPValue = pvalues[index];
	adjPValue = J(n,1,.);

	for(i=1,i&amp;lt;=n,i++,
		j = n-i+1;
		ratio = n/(n-i+1);
		adjPValue[j] = if (i==1,ordPValue[j],min(ratio*ordPValue[j],adjPValue[j+1]));
	);
	
	rowPValues = J(NRow(dtf),1,.);
	rowPValues[index] = adjPValue;
	sfx = pvalCol &amp;lt;&amp;lt; get name ();
	n_col_name = "FDR " || sfx;
	dtf&amp;lt;&amp;lt;NewColumn(n_col_name,Numeric,Values(rowPValues));
	
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Best ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TS&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 00:16:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-gt-JSL-gt-How-to-Pass-Arguments-to-Add-In-included-my-own/m-p/448792#M69560</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2022-01-04T00:16:58Z</dc:date>
    </item>
  </channel>
</rss>

