cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
Polyabc
Level II

Using variables in path name

Hello,

Please forgive me if this is a trivial question, I do not have much experience working with JSL. 

 

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.

 

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:

 

PictureBox(Open("c:/iris/"picture number" .jpg", jpg));

 

is this possible?

 

Many thanks!

 

10 REPLIES 10
nascif_jmp
Level VI

Re: Using variables in path name

Wow, excellent example, @jthi ! Thank you for sharing it!

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:

Picture Box(Open(Column("PicAdress")[local:_firstRow],jpg))

 For more information on this and other variables, see Hover Label Execution Context.