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
%3CLINGO-SUB%20id%3D%22lingo-sub-786162%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E8%A9%95%E4%BE%A1%E3%81%9B%E3%81%9A%E3%81%AB%E5%BC%8F%E3%82%92%E5%A4%89%E6%95%B0%E3%81%AB%E4%BF%9D%E5%AD%98%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF%E3%81%A9%E3%81%86%E3%81%99%E3%82%8C%E3%81%B0%E3%82%88%E3%81%84%E3%81%A7%E3%81%99%E3%81%8B%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-786162%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E5%A4%A7%E3%81%8D%E3%81%AA%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88%E3%81%AB%E5%8F%96%E3%82%8A%E7%B5%84%E3%82%93%E3%81%A7%E3%81%84%E3%82%8B%E3%81%A8%E3%81%8D%E3%81%AB%E3%80%81%E8%A1%A8%E7%8F%BE%E3%81%AB%E9%96%A2%E3%81%99%E3%82%8B%E8%88%88%E5%91%B3%E6%B7%B1%E3%81%84%E5%8B%95%E4%BD%9C%E3%81%AB%E6%B0%97%E3%81%A5%E3%81%8D%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E6%AC%A1%E3%81%AE%20jsl%20%E3%82%B3%E3%83%BC%E3%83%89%E3%82%92%E6%A4%9C%E8%A8%8E%E3%81%97%E3%81%A6%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%3CFONT%20color%3D%22%23339966%22%3E%2F%2F%20Create%20a%20namespace%20for%20cleanliness%3C%2FFONT%3E%0Ans%20%3D%20New%20Namespace(%22ns%22)%3B%0A%0A%3CFONT%20color%3D%22%23339966%22%3E%2F%2F%20Make%20an%20example%20data%20table%20dt%3C%2FFONT%3E%0Ans%3Adt%20%3D%20%3CFONT%20color%3D%22%233366FF%22%3ENew%20Table%3C%2FFONT%3E(%22window%22%2C%20%0A%09%09%09%09%3CFONT%20color%3D%22%233366FF%22%3ENew%20Column%3C%2FFONT%3E(%22a%22%2C%20set%20values(%5B1%2C2%2C3%5D))%2C%0A%09%09%09%09%3CFONT%20color%3D%22%233366FF%22%3ENew%20Column%3C%2FFONT%3E(%22b%22%2C%20set%20values(%5B1%2C4%2C9%5D))%0A)%3B%0A%0A%3CFONT%20color%3D%22%23339966%22%3E%2F%2F%201.%20Make%20an%20expression%20gr_exp1%20containing%20the%20graph%20builder%20instructions%3C%2FFONT%3E%0Ans%3Agr_exp1%20%3D%20%3CFONT%20color%3D%22%233366FF%22%3Eexpr%3C%2FFONT%3E(ns%3Agr%20%3D%20ns%3Adt%20%26lt%3B%26lt%3B%20%3CFONT%20color%3D%22%230000FF%22%3EGraph%20Builder%3C%2FFONT%3E(%0A%09%09%09%09%09%09Show%20Control%20Panel(%200%20)%2C%0A%09%09%09%09%09%09Variables(%20X(%20%3Aa%20)%2C%20Y(%20%3CLI-EMOJI%20id%3D%22lia_face-with-tongue%22%20title%3D%22%3Acara_con_la_lengua_fuera%3A%22%3E%3C%2FLI-EMOJI%3E%20)%20)%2C%0A%09%09%09%09%09%09Elements(%20Points(%20X%2C%20Y%2C%20Legend(%208%20)%20)%2C%20Smoother(%20X%2C%20Y%2C%20Legend(%209%20)%20)%20))%3B%0A%09%09%09%09)%3B%3CBR%20%2F%3E%3CFONT%20color%3D%22%23339966%22%3E%2F%2F%20Running%20the%20expression%20will%20build%20the%20graph%20(as%20expected)%0A%3CFONT%20color%3D%22%23000000%22%3Ens%3Agr_exp1%3B%3C%2FFONT%3E%3CBR%20%2F%3E%09%09%09%09%0A%2F%2F%202.%20Make%20a%20function%20f1%20that%20saves%20the%20graph%20builder%20instructions%20into%20an%20expression%20gr_exp2%3C%2FFONT%3E%0Ans%3Af1%20%3D%20%3CFONT%20color%3D%22%233366FF%22%3Efunction%3C%2FFONT%3E(%7B%7D%2C%7BDefault%20Local%7D%2C%0A%09ns%3Agr_exp2%20%3D%20%3CFONT%20color%3D%22%233366FF%22%3Eexpr%3C%2FFONT%3E(ns%3Agr%20%3D%20ns%3Adt%20%26lt%3B%26lt%3B%20%3CFONT%20color%3D%22%230000FF%22%3EGraph%20Builder%3C%2FFONT%3E(%0A%09%09%09%09%09%09Show%20Control%20Panel(%200%20)%2C%0A%09%09%09%09%09%09Variables(%20X(%20%3Aa%20)%2C%20Y(%20%3CLI-EMOJI%20id%3D%22lia_face-with-tongue%22%20title%3D%22%3Acara_con_la_lengua_fuera%3A%22%3E%3C%2FLI-EMOJI%3E%20)%20)%2C%0A%09%09%09%09%09%09Elements(%20Points(%20X%2C%20Y%2C%20Legend(%208%20)%20)%2C%20Smoother(%20X%2C%20Y%2C%20Legend(%209%20)%20)%20))%3B%0A%09)%3B%0A)%3B%0A%3CFONT%20color%3D%22%23339966%22%3E%2F%2F%20When%20one%20runs%20the%20function%2C%20the%20graph%20will%20be%20displayed%2C%20though%20only%20saving%20the%20%3CBR%20%2F%3E%2F%2F%20expression%20into%20a%20variable%20is%20desired.%3C%2FFONT%3E%0Ans%3Af1%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%E3%81%93%E3%81%AE%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88%E3%81%A7%E3%81%AF%E3%82%B0%E3%83%A9%E3%83%95%E3%82%92%E5%BC%8F%E3%81%A8%E3%81%97%E3%81%A6%E4%BF%9D%E5%AD%98%E3%81%97%20(%E5%BE%8C%E3%81%A7%E8%A9%95%E4%BE%A1%E3%81%99%E3%82%8B)%20%E3%81%9F%E3%81%8B%E3%81%A3%E3%81%9F%E3%81%A0%E3%81%91%E3%81%AA%E3%81%AE%E3%81%A7%E3%80%81%E3%83%9D%E3%83%83%E3%83%97%E3%82%A2%E3%83%83%E3%83%97%E3%81%AF%E8%A1%A8%E7%A4%BA%E3%81%97%E3%81%9F%E3%81%8F%E3%81%82%E3%82%8A%E3%81%BE%E3%81%9B%E3%82%93%E3%81%A7%E3%81%97%E3%81%9F%E3%80%82%E8%A9%A6%E8%A1%8C%E9%8C%AF%E8%AA%A4%E3%81%97%E3%81%9F%E7%B5%90%E6%9E%9C%E3%80%81%E5%BC%8F%E3%82%92%E5%88%A5%E3%81%AE%E5%BC%8F%E3%81%AB%E3%83%8D%E3%82%B9%E3%83%88%E3%81%99%E3%82%8B%E3%81%A8%E5%95%8F%E9%A1%8C%E3%81%8C%E8%A7%A3%E6%B1%BA%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%81%AB%E6%B0%97%E4%BB%98%E3%81%8D%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Ens%3Af2%20%3D%20%3CFONT%20color%3D%22%233366FF%22%3Efunction%3C%2FFONT%3E(%7B%7D%2C%7BDefault%20Local%7D%2C%0A%09ns%3Agr_exp2%20%3D%20%3CFONT%20color%3D%22%233366FF%22%3Eexpr%3C%2FFONT%3E(%3CFONT%20color%3D%22%233366FF%22%3Eexpr%3C%2FFONT%3E(ns%3Agr%20%3D%20ns%3Adt%20%26lt%3B%26lt%3B%20Graph%20Builder(%0A%09%09%09%09%09%09Show%20Control%20Panel(%200%20)%2C%0A%09%09%09%09%09%09Variables(%20X(%20%3Aa%20)%2C%20Y(%20%3CLI-EMOJI%20id%3D%22lia_face-with-tongue%22%20title%3D%22%3Acara_con_la_lengua_fuera%3A%22%3E%3C%2FLI-EMOJI%3E%20)%20)%2C%0A%09%09%09%09%09%09Elements(%20Points(%20X%2C%20Y%2C%20Legend(%208%20)%20)%2C%20Smoother(%20X%2C%20Y%2C%20Legend(%209%20)%20)%20))%3B%0A%09))%3B%0A)%3B%3CBR%20%2F%3E%3CFONT%20color%3D%22%23339966%22%3E%2F%2F%20Now%20no%20graph%20is%20displayed%20when%20running%20the%20function%2C%20and%20the%20expression%20is%20saved!%3C%2FFONT%3E%3CBR%20%2F%3Ens%3Af2%3B%3CBR%20%2F%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%E3%81%93%E3%82%8C%E3%81%A7%E5%95%8F%E9%A1%8C%E3%81%AF%E8%A7%A3%E6%B1%BA%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%E3%81%97%E3%81%8B%E3%81%97%E3%80%81%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88%E3%81%AE%E6%A7%8B%E9%80%A0%E3%82%92%E8%80%83%E3%81%88%E3%82%8B%E3%81%A8%E3%80%81%E5%AE%9F%E9%9A%9B%E3%81%AB%E3%81%AF%E9%96%A2%E6%95%B0%20f2%20%E3%82%92%E5%88%A5%E3%81%AE%E9%96%A2%E6%95%B0%E3%80%81%E3%81%9F%E3%81%A8%E3%81%88%E3%81%B0%20f3%20%E3%81%8B%E3%82%89%E5%91%BC%E3%81%B3%E5%87%BA%E3%81%99%E5%BF%85%E8%A6%81%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%3CFONT%20color%3D%22%23339966%22%3E%2F%2F%204.%20Now%20make%20a%20function%20f3%20that%20calls%20f2%20(with%20the%20idea%20of%20simply%20saving%20an%20expression)%3C%2FFONT%3E%0Ans%3Af3%20%3D%20%3CFONT%20color%3D%22%233366FF%22%3Efunction%3C%2FFONT%3E(%7B%7D%2C%7BDefault%20Local%7D%2C%0A%09ns%3Af2%3B%0A)%3B%0A%0A%3CFONT%20color%3D%22%23339966%22%3E%2F%2F%20Running%20the%20script%20will%20produce%20a%20graph%20again...%3C%2FFONT%3E%0Ans%3Af3%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%E3%81%9D%E3%81%AE%E5%BE%8C%E3%80%81%E9%96%A2%E6%95%B0%20f2%20%E3%82%92%E5%A4%89%E6%9B%B4%E3%81%97%E3%81%A6%203%20%E9%87%8D%E3%83%8D%E3%82%B9%E3%83%88%E3%81%95%E3%82%8C%E3%81%9F%E5%BC%8F%E3%81%AB%E3%81%99%E3%82%8B%E3%81%A8%E5%95%8F%E9%A1%8C%E3%81%8C%E8%A7%A3%E6%B1%BA%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%81%AB%E6%B0%97%E4%BB%98%E3%81%8D%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%E3%82%B0%E3%83%A9%E3%83%95%E3%82%92%E5%BC%8F%E3%81%A8%E3%81%97%E3%81%A6%E4%BF%9D%E5%AD%98%E3%81%97%E3%80%81%E3%81%9D%E3%81%AE%E8%A9%95%E4%BE%A1%E3%82%92%E6%8A%91%E5%88%B6%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%3CFONT%20color%3D%22%23339966%22%3E%2F%2F%20This%20can%20be%20solved%20by%20modifying%20f2%3C%2FFONT%3E%20%0Ans%3Af2%20%3D%20%3CFONT%20color%3D%22%233366FF%22%3Efunction%3C%2FFONT%3E(%7B%7D%2C%7BDefault%20Local%7D%2C%0A%09ns%3Agr_exp2%20%3D%20%3CFONT%20color%3D%22%233366FF%22%3Eexpr%3C%2FFONT%3E(%3CFONT%20color%3D%22%233366FF%22%3Eexpr%3C%2FFONT%3E(%3CFONT%20color%3D%22%233366FF%22%3Eexpr%3C%2FFONT%3E(ns%3Agr%20%3D%20ns%3Adt%20%26lt%3B%26lt%3B%20Graph%20Builder(%0A%09%09%09%09%09%09Show%20Control%20Panel(%200%20)%2C%0A%09%09%09%09%09%09Variables(%20X(%20%3Aa%20)%2C%20Y(%20%3CLI-EMOJI%20id%3D%22lia_face-with-tongue%22%20title%3D%22%3Acara_con_la_lengua_fuera%3A%22%3E%3C%2FLI-EMOJI%3E%20)%20)%2C%0A%09%09%09%09%09%09Elements(%20Points(%20X%2C%20Y%2C%20Legend(%208%20)%20)%2C%20Smoother(%20X%2C%20Y%2C%20Legend(%209%20)%20)%20))%3B%0A%09)))%3B%0A)%3B%0A%0A%3CFONT%20color%3D%22%23339966%22%3E%2F%2F%20Running%20f3%20now%20acts%20as%20desired%20(saves%20expression%20and%20suppresses%20evaluation%20of%20graph)%3C%2FFONT%3E%0Ans%3Af3%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%E7%A7%81%E3%81%AF%E3%81%93%E3%81%AE%E5%95%8F%E9%A1%8C%E3%82%92%E3%81%AA%E3%82%93%E3%81%A8%E3%81%8B%E4%B9%97%E3%82%8A%E8%B6%8A%E3%81%88%E3%81%BE%E3%81%97%E3%81%9F%E3%81%8C%E3%80%81%E7%A7%81%E3%81%AE%E7%96%91%E5%95%8F%E3%81%AF%E6%AC%A1%E3%81%AE%E3%81%A8%E3%81%8A%E3%82%8A%E3%81%A7%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E5%91%BC%E3%81%B3%E5%87%BA%E3%81%97%E6%99%82%E3%81%AB%E5%BC%8F%E3%82%92%E8%A9%95%E4%BE%A1%3CSTRONG%3E%E3%81%9B%E3%81%9A%E3%81%AB%3C%2FSTRONG%3E%E5%BC%8F%E3%82%92%E5%A4%89%E6%95%B0%E3%81%AB%E4%BF%9D%E5%AD%98%E3%81%99%E3%82%8B%E9%96%A2%E6%95%B0%E3%82%92%20(%E6%AD%A3%E3%81%97%E3%81%8F)%20%E4%BD%9C%E6%88%90%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF%E3%81%A9%E3%81%86%E3%81%99%E3%82%8C%E3%81%B0%E3%82%88%E3%81%84%E3%81%A7%E3%81%99%E3%81%8B%3F%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E7%A7%81%E3%81%AF%20JMP%20Pro%2018.0%20%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%E3%81%94%E5%8A%A9%E8%A8%80%E3%82%84%E3%82%B3%E3%83%A1%E3%83%B3%E3%83%88%E3%82%92%E3%81%84%E3%81%9F%E3%81%A0%E3%81%91%E3%82%8C%E3%81%B0%E5%B9%B8%E3%81%84%E3%81%A7%E3%81%99%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-786162%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3E%E8%87%AA%E5%8B%95%E5%8C%96%E3%81%A8%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-786229%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20%E8%A9%95%E4%BE%A1%E3%81%9B%E3%81%9A%E3%81%AB%E5%A4%89%E6%95%B0%E3%81%AB%E5%BC%8F%E3%82%92%E4%BF%9D%E5%AD%98%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF%E3%81%A9%E3%81%86%E3%81%99%E3%82%8C%E3%81%B0%E3%81%84%E3%81%84%E3%81%A7%E3%81%99%E3%81%8B%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-786229%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.jmp.com%2Fsupport%2Fhelp%2Fen%2F18.0%2F%23page%2Fjmp%2Fexpression-functions.shtml%3Fos%3Dwin%26amp%3Bsource%3Dapplication%23ww4993368%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EName%20Expr()%20%E3%81%AF%3C%2FA%3E%E3%81%82%E3%81%AA%E3%81%9F%E3%81%8C%E6%8E%A2%E3%81%97%E3%81%A6%E3%81%84%E3%82%8B%E3%82%AA%E3%83%97%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AE1%E3%81%A4%E3%81%8B%E3%82%82%E3%81%97%E3%82%8C%E3%81%BE%E3%81%9B%E3%82%93%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22jthi_0-1724782668368.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1724782668368.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1724782668368.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1724782668368.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1724782668368.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F67579i3595B743686DF801%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22jthi_0-1724782668368.png%22%20alt%3D%22jthi_0-1724782668368.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.jmp.com%2Fsupport%2Fhelp%2Fen%2F18.0%2F%23page%2Fjmp%2Fadvanced-expressions-macros-and-lists.shtml%23ww339382%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.jmp.com%2Fsupport%2Fhelp%2Fen%2F18.0%2F%23page%2Fjmp%2Fadvanced-expressions-macros-and-lists.shtml%23ww339382%3C%2FA%3E%E3%81%AF%E8%89%AF%E3%81%84%E8%AA%AD%E3%81%BF%E7%89%A9%E3%81%8B%E3%82%82%E3%81%97%E3%82%8C%E3%81%BE%E3%81%9B%E3%82%93%E3%80%82%E3%81%BE%E3%81%9F%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FJMPer-Cable%2FExpression-Handling-Functions-Part-I-Unraveling-the-Expr%2Fm-p%2F28963%23U28963%22%20class%3D%22lia-mention-container-editor-message%20lia-img-icon-blog-thread%20lia-fa-icon%20lia-fa-blog%20lia-fa-thread%20lia-fa%22%20target%3D%22_blank%22%3E%E3%80%81%E5%BC%8F%E5%87%A6%E7%90%86%E9%96%A2%E6%95%B0%3A%20%E3%83%91%E3%83%BC%E3%83%88%20I%20-%20Expr()%E3%80%81NameExpr()%E3%80%81Eval()%E3%80%81...%20%E3%81%AE%E8%AC%8E%E3%82%92%E8%A7%A3%E6%98%8E%E3%81%99%E3%82%8B%3C%2FA%3E(%E7%A7%81%E3%81%AE%E7%9F%A5%E3%82%8B%E9%99%90%E3%82%8A%E3%80%81%E3%83%91%E3%83%BC%E3%83%88%202%20%E3%81%AF%E3%81%82%E3%82%8A%E3%81%BE%E3%81%9B%E3%82%93)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-788120%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3ERe%3A%20%E8%A9%95%E4%BE%A1%E3%81%9B%E3%81%9A%E3%81%AB%E5%A4%89%E6%95%B0%E3%81%AB%E5%BC%8F%E3%82%92%E4%BF%9D%E5%AD%98%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF%E3%81%A9%E3%81%86%E3%81%99%E3%82%8C%E3%81%B0%E3%81%84%E3%81%84%E3%81%A7%E3%81%99%E3%81%8B%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-788120%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3E%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F38150%22%20target%3D%22_blank%22%3E%40ThomasB%3C%2FA%3E%20%E3%80%81%3C%2FP%3E%3CP%3E%E9%96%A2%E6%95%B0%E3%81%AE%E6%9C%80%E5%BE%8C%E3%81%AE%E5%BC%8F%E3%81%8C%E6%88%BB%E3%82%8A%E5%80%A4%E3%81%A8%E3%81%97%E3%81%A6%E4%BD%BF%E7%94%A8%E3%81%95%E3%82%8C%E3%82%8B%E3%81%93%E3%81%A8%E3%81%AB%E6%B3%A8%E6%84%8F%E3%81%97%E3%81%A6%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%E3%80%82%3CBR%20%2F%3E%E5%BC%8F%E3%82%92%E3%80%8C%E8%BF%94%E3%81%99%E3%80%8D%E3%81%93%E3%81%A8%E3%81%AA%E3%81%8F%E5%89%B2%E3%82%8A%E5%BD%93%E3%81%A6%E3%82%8B%E3%81%A0%E3%81%91%E3%81%AE%E5%A0%B4%E5%90%88%E3%81%AF%E3%80%81%E3%83%80%E3%83%9F%E3%83%BC%E3%81%AE%E6%88%BB%E3%82%8A%E5%80%A4%E3%82%92%E8%BF%BD%E5%8A%A0%E3%81%97%E3%81%A6%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Ens%3Af1%20%3D%20function(%7B%7D%2C%7BDefault%20Local%7D%2C%0A%09ns%3Agr_exp2%20%3D%20expr(ns%3Agr%20%3D%20ns%3Adt%20%26lt%3B%26lt%3B%20Graph%20Builder(%0A%09%09%09%09%09%09Show%20Control%20Panel(%200%20)%2C%0A%09%09%09%09%09%09Variables(%20X(%20%3Aa%20)%2C%20Y(%20%20)%20)%2C%0A%09%09%09%09%09%09Elements(%20Points(%20X%2C%20Y%2C%20Legend(%208%20)%20)%2C%20Smoother(%20X%2C%20Y%2C%20Legend(%209%20)%20)%20))%3B%0A%09)%3B%0A%091%3B%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%E3%81%BE%E3%81%9F%E3%81%AF%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Ens%3Af1%20%3D%20function(%7B%7D%2C%7BDefault%20Local%7D%2C%0A%09ns%3Agr_exp2%20%3D%20expr(ns%3Agr%20%3D%20ns%3Adt%20%26lt%3B%26lt%3B%20Graph%20Builder(%0A%09%09%09%09%09%09Show%20Control%20Panel(%200%20)%2C%0A%09%09%09%09%09%09Variables(%20X(%20%3Aa%20)%2C%20Y(%20%20)%20)%2C%0A%09%09%09%09%09%09Elements(%20Points(%20X%2C%20Y%2C%20Legend(%208%20)%20)%2C%20Smoother(%20X%2C%20Y%2C%20Legend(%209%20)%20)%20))%3B%0A%09)%3B%0A%09return(1)%3B%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-789644%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20%E8%A9%95%E4%BE%A1%E3%81%9B%E3%81%9A%E3%81%AB%E5%A4%89%E6%95%B0%E3%81%AB%E5%BC%8F%E3%82%92%E4%BF%9D%E5%AD%98%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF%E3%81%A9%E3%81%86%E3%81%99%E3%82%8C%E3%81%B0%E3%81%84%E3%81%84%E3%81%A7%E3%81%99%E3%81%8B%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-789644%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EJarmo%E3%81%95%E3%82%93%E3%80%81%E8%BF%94%E4%BF%A1%E3%81%A8%E3%83%AA%E3%83%B3%E3%82%AF%E3%82%92%E3%81%82%E3%82%8A%E3%81%8C%E3%81%A8%E3%81%86%E3%81%94%E3%81%96%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%E3%81%A8%E3%81%A6%E3%82%82%E5%BD%B9%E3%81%AB%E7%AB%8B%E3%81%A1%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
ThomasB
Level II

how to save expressions in a variable without evaluating?

While working on a big script, I noticed some interesting behavior regarding expressions.

 

Consider the following piece of jsl code:

 

// Create a namespace for cleanliness
ns = New Namespace("ns");

// Make an example data table dt
ns:dt = New Table("window", 
				New Column("a", set values([1,2,3])),
				New Column("b", set values([1,4,9]))
);

// 1. Make an expression gr_exp1 containing the graph builder instructions
ns:gr_exp1 = expr(ns:gr = ns:dt << Graph Builder(
						Show Control Panel( 0 ),
						Variables( X( :a ), Y(  ) ),
						Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) ));
				);
// Running the expression will build the graph (as expected) ns:gr_exp1;
// 2. Make a function f1 that saves the graph builder instructions into an expression gr_exp2
ns:f1 = function({},{Default Local}, ns:gr_exp2 = expr(ns:gr = ns:dt << Graph Builder( Show Control Panel( 0 ), Variables( X( :a ), Y( ) ), Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) )); ); ); // When one runs the function, the graph will be displayed, though only saving the
// expression into a variable is desired.
ns:f1;

Since for this script I just wanted to save the graph as an expression (and evaluate later), I did not want it to pop-up. After some trial and error, I noticed that nesting the expression in another expression solved the problem:

 

ns:f2 = function({},{Default Local},
	ns:gr_exp2 = expr(expr(ns:gr = ns:dt << Graph Builder(
						Show Control Panel( 0 ),
						Variables( X( :a ), Y(  ) ),
						Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) ));
	));
);
// Now no graph is displayed when running the function, and the expression is saved!
ns:f2;

That solved my issue. But, given the structure of my script, I actually needed to call the function f2 from another function, say f3:

// 4. Now make a function f3 that calls f2 (with the idea of simply saving an expression)
ns:f3 = function({},{Default Local},
	ns:f2;
);

// Running the script will produce a graph again...
ns:f3;

Then I noticed that modifying the function f2 to have a triple nested expression solved the issue - it saves the graph as an expression, while suppressing its evaluation:

// This can be solved by modifying f2 
ns:f2 = function({},{Default Local},
	ns:gr_exp2 = expr(expr(expr(ns:gr = ns:dt << Graph Builder(
						Show Control Panel( 0 ),
						Variables( X( :a ), Y(  ) ),
						Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) ));
	)));
);

// Running f3 now acts as desired (saves expression and suppresses evaluation of graph)
ns:f3;

While I have managed to navigate through this issue, my question is:

 

How do I (correctly) make a function that, upon calling it, saves the expression into a variable without evaluating the expression? 

 

I'm using JMP Pro 18.0. Any help or comments are appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
hogi
Level XII

Re: how to save expressions in a variable without evaluating?

Hi @ThomasB ,

please note that the last expression of a function is used as the return value.
If you just want to assign the expression without "returning" it, please add a dummy return value:

 

ns:f1 = function({},{Default Local},
	ns:gr_exp2 = expr(ns:gr = ns:dt << Graph Builder(
						Show Control Panel( 0 ),
						Variables( X( :a ), Y(  ) ),
						Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) ));
	);
	1;
);

or 

 

ns:f1 = function({},{Default Local},
	ns:gr_exp2 = expr(ns:gr = ns:dt << Graph Builder(
						Show Control Panel( 0 ),
						Variables( X( :a ), Y(  ) ),
						Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) ));
	);
	return(1);
);

 

 

View solution in original post

3 REPLIES 3
jthi
Super User

Re: how to save expressions in a variable without evaluating?

hogi
Level XII

Re: how to save expressions in a variable without evaluating?

Hi @ThomasB ,

please note that the last expression of a function is used as the return value.
If you just want to assign the expression without "returning" it, please add a dummy return value:

 

ns:f1 = function({},{Default Local},
	ns:gr_exp2 = expr(ns:gr = ns:dt << Graph Builder(
						Show Control Panel( 0 ),
						Variables( X( :a ), Y(  ) ),
						Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) ));
	);
	1;
);

or 

 

ns:f1 = function({},{Default Local},
	ns:gr_exp2 = expr(ns:gr = ns:dt << Graph Builder(
						Show Control Panel( 0 ),
						Variables( X( :a ), Y(  ) ),
						Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) ));
	);
	return(1);
);

 

 

ThomasB
Level II

Re: how to save expressions in a variable without evaluating?

Thank you for your reply and the link, Jarmo, they are also very helpful.