<?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: Using variables in path name in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/344012#M59363</link>
    <description>&lt;P&gt;Check the log for messages. One or more of the following might help.&lt;/P&gt;&lt;P&gt;Build the path name in a variable and print it to the log, then pass the variable to open.&lt;/P&gt;&lt;P&gt;Add quotation marks around the 2nd parameter to open.&lt;/P&gt;&lt;P&gt;Add the data table scope before the column name.&lt;/P&gt;&lt;P&gt;Add a row number subscript after the column name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;edit: use the char() function to convert numeric to character!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;filename = "c:/iris/" || char(dt:picture number[1]) || ".jpg";
show(filename);
PictureBox(Open( filename, "jpg"));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Dec 2020 15:04:55 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2020-12-23T15:04:55Z</dc:date>
    <item>
      <title>Using variables in path name</title>
      <link>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/343684#M59309</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Please forgive me if this is a trivial question, I do not have much experience working with JSL.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to add a picture to the hover label using JSL code, and want to define the picture path using a variable. I have a folder of pictures, and want them to be called using a variable in my table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, my pictures are labeled 1 to 100, and I have a column in my table called "picture number". I want to be able to call them, like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;PictureBox(Open("c:/iris/"picture number" .jpg", jpg));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is this possible?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 22:01:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/343684#M59309</guid>
      <dc:creator>Polyabc</dc:creator>
      <dc:date>2023-06-09T22:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using variables in path name</title>
      <link>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/343707#M59311</link>
      <description>&lt;P&gt;Yes, some variation of this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;img &amp;lt;&amp;lt; saveimage( "f:/path/x" || Char( imagenumber ) || ".png", "png" );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;x is the prefix before the number and is not required by the operating system.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2020 10:24:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/343707#M59311</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2020-12-22T10:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using variables in path name</title>
      <link>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/343730#M59314</link>
      <description>&lt;P&gt;thanks! i'll give it a try.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2020 11:12:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/343730#M59314</guid>
      <dc:creator>Polyabc</dc:creator>
      <dc:date>2020-12-22T11:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using variables in path name</title>
      <link>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/344001#M59354</link>
      <description>&lt;P&gt;Using a specific picture number works fine, but I cannot insert a variable name (the variable column is "picture number") to this path, for example, the following does not work. Any idea how to fix this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;PictureBox(Open("c:/iris/" || :picture number|| ".jpg", jpg));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Dec 2020 08:37:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/344001#M59354</guid>
      <dc:creator>Polyabc</dc:creator>
      <dc:date>2020-12-23T08:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using variables in path name</title>
      <link>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/344004#M59357</link>
      <description>&lt;P&gt;If you check out the example Hover Label Editor gives for Picture Graphlet&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Example:
//   Graph Builder(Variables(Y(local:_measurements[1])), Elements(Histogram(Y)))
// Example: 
//   PictureBox(Open("c:/iris/" || local:_Species || ".jpg", jpg));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the syntax seems be a bit special. Maybe it would work with something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;PictureBox(Open("c:/iris/" || char(local:_picture number)|| ".jpg", jpg));&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 23 Dec 2020 10:18:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/344004#M59357</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2020-12-23T10:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using variables in path name</title>
      <link>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/344012#M59363</link>
      <description>&lt;P&gt;Check the log for messages. One or more of the following might help.&lt;/P&gt;&lt;P&gt;Build the path name in a variable and print it to the log, then pass the variable to open.&lt;/P&gt;&lt;P&gt;Add quotation marks around the 2nd parameter to open.&lt;/P&gt;&lt;P&gt;Add the data table scope before the column name.&lt;/P&gt;&lt;P&gt;Add a row number subscript after the column name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;edit: use the char() function to convert numeric to character!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;filename = "c:/iris/" || char(dt:picture number[1]) || ".jpg";
show(filename);
PictureBox(Open( filename, "jpg"));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Dec 2020 15:04:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/344012#M59363</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2020-12-23T15:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using variables in path name</title>
      <link>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/344013#M59364</link>
      <description>&lt;P&gt;You might want to check this thread. They had the same use case. The thread contains many script examples that you should find useful.&lt;/P&gt;
&lt;P&gt;&lt;LI-MESSAGE title="Hover label" uid="287358" url="https://community.jmp.com/t5/Discussions/Hover-label/m-p/287358#U287358" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Dec 2020 20:05:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/344013#M59364</guid>
      <dc:creator>nascif_jmp</dc:creator>
      <dc:date>2020-12-23T20:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using variables in path name</title>
      <link>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/344712#M59454</link>
      <description>&lt;P&gt;Thanks for the responses.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a follow up question. I want the hover label to get the file address from a column. My column has the address itself, for example, the text in my Colum (named PicAdress) is&amp;nbsp;"c:/iris/picNumber.jpg" .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, I cannot get the hovel label to accept this variable. i have tried using:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;PictureBox(Open(local:_PicAdress, jpg))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;with no success.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I simply enter the address in the column there is no problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;PictureBox(Open("c:/iris/" || local:_PicAdress || ".jpg", jpg))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any advice?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jan 2021 22:12:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/344712#M59454</guid>
      <dc:creator>Polyabc</dc:creator>
      <dc:date>2021-01-03T22:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using variables in path name</title>
      <link>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/344713#M59455</link>
      <description>&lt;P&gt;Try checking out the log to see what errors you are getting. Most likely something like this: "The namespace "local_" is not defined in access or evaluation of 'local_:PicAdress'".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try out something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Picture Box(Open(Column("PicAdress")[local:_firstRow],jpg))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;More info possibly from:&amp;nbsp;&lt;LI-MESSAGE title="How to run a query on mouseover, using data from the underlying datapoint?" uid="303372" url="https://community.jmp.com/t5/Discussions/How-to-run-a-query-on-mouseover-using-data-from-the-underlying/m-p/303372#U303372" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit:&lt;/P&gt;
&lt;P&gt;I added example script. It will create couple of files (10 by default) to $TEMP (and attempt to delete them on window close) and create window with two graph builders:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;First will build path from the data in graph builder using this idea:&amp;nbsp;&lt;CODE class=" language-jsl"&gt;PictureBox(Open("c:/iris/" || local:_PicAdress || ".jpg", jpg))&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;Second is using only the row information from graph builder and getting data based on row from datatable&amp;nbsp;&lt;CODE class=" language-jsl"&gt;Picture Box(Open(Column("PicAdress")[local:_firstRow],jpg))&lt;/CODE&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Mon, 04 Jan 2021 16:22:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/344713#M59455</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-01-04T16:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using variables in path name</title>
      <link>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/344714#M59456</link>
      <description>&lt;P&gt;Thanks a lot, this works great.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2020 09:24:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/344714#M59456</guid>
      <dc:creator>Polyabc</dc:creator>
      <dc:date>2020-12-29T09:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using variables in path name</title>
      <link>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/344825#M59482</link>
      <description>&lt;P&gt;Wow, excellent example, &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt; ! Thank you for sharing it!&lt;/P&gt;
&lt;P&gt;The trick here is that when you are building the image fine name from a table column, you have to indicate the column name AND the row. Inside the Local namespace populated by the graphlet execution context, the current row is available in the variable local:_firstRow. Thus the construct:&lt;/P&gt;
&lt;LI-CODE lang="jsl"&gt;Picture Box(Open(Column("PicAdress")[local:_firstRow],jpg))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;For more information on this and other variables, see &lt;A href="https://www.jmp.com/support/help/en/15.2/index.shtml#page/jmp/work-with-the-hover-label-execution-context.shtml" target="_self"&gt;Hover Label Execution Context&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2020 17:29:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-variables-in-path-name/m-p/344825#M59482</guid>
      <dc:creator>nascif_jmp</dc:creator>
      <dc:date>2020-12-29T17:29:03Z</dc:date>
    </item>
  </channel>
</rss>

