cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
%3CLINGO-SUB%20id%3D%22lingo-sub-749312%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%84%AA%E5%8C%96%E5%88%97%E9%8C%B6%E6%A1%86%E5%85%A7%E5%AE%B9%E6%9B%B4%E6%96%B0%E3%80%82%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-749312%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EJMP%20%E7%A4%BE%E7%BE%A4%E6%82%A8%E5%A5%BD%EF%BC%8C%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E6%9C%80%E8%BF%91%EF%BC%8C%E6%88%91%E6%AD%A3%E5%9C%A8%E7%A0%94%E7%A9%B6%E6%8F%90%E9%AB%98%E5%85%A7%E9%83%A8%20JSL%20%E8%85%B3%E6%9C%AC%E7%9A%84%E6%95%88%E8%83%BD%EF%BC%8C%E4%B8%A6%E7%99%BC%E7%8F%BE%E4%BA%86%E4%BB%A5%E4%B8%8B%E6%88%91%E6%83%B3%E8%A7%A3%E6%B1%BA%E7%9A%84%E6%95%88%E8%83%BD%E5%95%8F%E9%A1%8C%E3%80%82%3C%2FP%3E%3CP%3E%E8%AE%93%E6%88%91%E5%80%91%E4%BD%BF%E7%94%A8%E4%BB%A5%E4%B8%8B%E8%85%B3%E6%9C%AC%EF%BC%88%E5%9C%A8%20macOS%20%E4%B8%8A%E9%81%8B%E8%A1%8C%E7%9A%84%20JMP%2017.2%20PRO%EF%BC%89%EF%BC%9A%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0Adt%20%3D%20Open(%20%22%24SAMPLE_DATA%2FBig%20Class.jmp%22%20)%3B%0A%0Avalues%20%3D%20Column(%20dt%2C%201%20)%5Bdt%20%26lt%3B%26lt%3B%20get%20rows%20where(%20Excluded(%20Row%20State()%20)%20!%3D%201%20)%5D%3B%0Anew%20window(%22test%22%2C%20%0A%09lb%20%3D%20list%20box(%20values%2C%20nlines(10)%2C%20width(100)%2C%20)%2C%0A%09b%20%3D%20button%20box(%22reset%22%2C%20reset_lb)%2C%0A%09)%3B%0A%09%0Areset_lb%20%3D%20expr(%0A%09lb%20%26lt%3B%26lt%3B%20remove%20all()%3B%0A%09lb%20%26lt%3B%26lt%3B%20append(values)%3B%0A%09%0A%09Nnames%20%3D%20N%20Items(values)%3B%0A%09for(i%20%3D%201%2C%20i%20%26lt%3B%3D%20Nnames%2C%20i%2B%2B%2C%0A%09%09lb%20%26lt%3B%26lt%3B%20set%20selected(i)%3B%0A%09)%3B%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%E5%9C%A8%E6%88%91%E7%9A%84%E4%B8%80%E4%BA%9B%E8%85%B3%E6%9C%AC%E4%B8%AD%EF%BC%8C%E6%88%91%E4%BD%BF%E7%94%A8%E5%8B%95%E6%85%8B%E6%9B%B4%E6%96%B0%E7%9A%84%E5%88%97%E9%8C%B6%E6%A1%86%E3%80%82%E7%82%BA%E4%BA%86%E6%9B%B4%E6%94%B9%E5%88%97%E9%8C%B6%E6%A1%86%E7%9A%84%E5%85%A7%E5%AE%B9%EF%BC%8C%E6%88%91%E4%BD%BF%E7%94%A8%3CSTRONG%3E%26lt%3B%3CREMOVE%3E%E5%92%8C%3CSTRONG%3E%26lt%3B%3CAPPEND%3E%E5%87%BD%E6%95%B8%EF%BC%8C%E5%AE%83%E5%80%91%E5%B7%A5%E4%BD%9C%E5%BE%97%E5%BE%88%E5%A5%BD%EF%BC%8C%E4%BD%86%E6%88%91%E6%93%94%E5%BF%83%E9%80%99%E7%A8%AE%E6%96%B9%E6%B3%95%E4%B8%8D%E8%83%BD%E5%BE%88%E5%A5%BD%E5%9C%B0%E9%9A%A8%E8%A1%8C%E6%95%B8%E7%B8%AE%E6%94%BE%EF%BC%8C%E9%80%99%E6%98%AF%E4%BB%A4%E4%BA%BA%E9%A9%9A%E8%A8%9D%E7%9A%84%E5%8F%A6%E4%B8%80%E9%83%A8%E5%88%86%E9%81%8B%E8%A1%8C%E9%80%9F%E5%BA%A6%E9%9D%9E%E5%B8%B8%E6%85%A2%E7%9A%84%E6%98%AF%E5%B8%B6%E6%9C%89%3CSTRONG%3E%26lt%3B%26lt%3B%20set%20selected()%20%E7%9A%84%20for%20%E5%BE%AA%E7%92%B0%EF%BC%8C%3C%2FSTRONG%3E%E9%A1%AF%E7%84%B6%E9%80%99%E6%98%AF%E6%88%91%E8%83%BD%E6%89%BE%E5%88%B0%E7%9A%84%E7%94%A8%E6%96%BC%E9%81%B8%E6%93%87%E5%88%97%E9%8C%B6%E6%A1%86%E4%B8%AD%E6%89%80%E6%9C%89%E9%A0%85%E7%9B%AE%E7%9A%84%E5%94%AF%E4%B8%80%E6%96%B9%E6%B3%95%EF%BC%8C%E4%BD%86%E5%AE%83%E6%9C%83%E9%9A%A8%E8%91%97%E8%A1%8C%E6%95%B8%E7%9A%84%E8%AE%8A%E5%8C%96%E8%80%8C%E6%80%A5%E5%8A%87%E8%AE%8A%E5%8C%96%E3%80%82%3C%2FAPPEND%3E%3C%2FSTRONG%3E%3C%2FREMOVE%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E6%88%91%E7%9A%84%E5%95%8F%E9%A1%8C%E6%98%AF%E6%98%AF%E5%90%A6%E6%9C%89%E4%BB%BB%E4%BD%95%E5%B7%B2%E7%9F%A5%E7%9A%84%E6%96%B9%E6%B3%95%E4%BE%86%E6%9B%B4%E6%96%B0%E5%88%97%E9%8C%B6%E6%A1%86%E7%9A%84%E5%85%A7%E5%AE%B9%EF%BC%8C%E4%B8%A6%E4%B8%94%E6%95%88%E8%83%BD%E4%B8%8D%E6%9C%83%E9%99%8D%E4%BD%8E%E3%80%82%E6%88%91%E6%AD%A3%E5%9C%A8%E5%B0%8B%E6%89%BE%E5%8F%AF%E8%83%BD%E7%9A%84%E6%9B%BF%E4%BB%A3%E6%96%B9%E6%A1%88%EF%BC%9A%3C%2FP%3E%3COL%3E%3CLI%3E%E8%A8%AD%E5%AE%9A%E5%88%97%E9%8C%B6%E6%A1%86%E5%85%A7%E5%AE%B9%E7%9A%84%E6%9C%80%E4%BD%B3%E6%96%B9%E6%B3%95%E3%80%82%3C%2FLI%3E%3CLI%3E%E9%81%B8%E6%93%87%E5%88%97%E9%8C%B6%E6%A1%86%E4%B8%AD%E6%89%80%E6%9C%89%E9%A0%85%E7%9B%AE%E7%9A%84%E5%BF%AB%E9%80%9F%E6%96%B9%E6%B3%95%E3%80%82%3C%2FLI%3E%3C%2FOL%3E%3CP%3E%E4%BB%BB%E4%BD%95%E5%8F%8D%E9%A5%8B%E6%88%96%E5%BB%BA%E8%AD%B0%E5%B0%87%E4%B8%8D%E5%8B%9D%E6%84%9F%E6%BF%80%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-749312%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3E%E8%87%AA%E5%8B%95%E5%8C%96%E5%92%8C%E8%85%B3%E6%9C%AC%E7%B7%A8%E5%AF%AB%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3E%E6%95%B8%E6%93%9A%E6%8E%A2%E7%B4%A2%E5%92%8C%E8%A6%96%E8%A6%BA%E5%8C%96%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3E%E8%98%8B%E6%9E%9C%E7%B3%BB%E7%B5%B1%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-749336%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E5%84%AA%E5%8C%96%E5%88%97%E9%8C%B6%E6%A1%86%E5%85%A7%E5%AE%B9%E6%9B%B4%E6%96%B0%E3%80%82%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-749336%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3E%E6%82%A8%E5%B8%8C%E6%9C%9B%E5%88%97%E9%8C%B6%E6%A1%86%E4%B8%AD%E6%9C%89%E5%A4%9A%E5%B0%91%E9%A0%85%EF%BC%9F%E5%B0%8D%E6%96%BC%201%EF%BC%8C%E6%82%A8%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%20%26lt%3B%26lt%3B%20Set%20Items()%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3E%E7%B7%A8%E8%BC%AF%EF%BC%9A%3C%2FP%3E%0A%3CDIV%20class%3D%22lia-byline-wrapper%22%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FJMP-Wish-List%2FCan-the-listbox-have-a-select-all-command%2Fm-p%2F670072%23U670072%22%20class%3D%22lia-mention-container-editor-message%20lia-img-icon-idea-thread%20lia-fa-icon%20lia-fa-idea%20lia-fa-thread%20lia-fa%22%20target%3D%22_blank%22%3E%E5%88%97%E9%8C%B6%E6%A1%86%E5%8F%AF%E4%BB%A5%E6%9C%89%E4%B8%80%E5%80%8B%E5%85%A8%E9%81%B8%E5%91%BD%E4%BB%A4%3C%2FA%3E%E9%A1%98%E6%9C%9B%E6%B8%85%E5%96%AE%E9%A0%85%E7%9B%AE%E8%99%95%E6%96%BC%E3%80%8C%E6%88%91%E5%80%91%E5%96%9C%E6%AD%A1%E5%AE%83%EF%BC%81%EF%BC%88%E5%9C%A8%E4%BD%87%E5%88%97%E4%B8%AD%EF%BC%89%E3%80%8D%E7%8B%80%E6%85%8B%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-749337%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E5%84%AA%E5%8C%96%E5%88%97%E9%8C%B6%E6%A1%86%E5%85%A7%E5%AE%B9%E6%9B%B4%E6%96%B0%E3%80%82%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-749337%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%E8%B3%88%E8%8E%AB%EF%BC%8C%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E6%84%9F%E8%AC%9D%E6%82%A8%E7%9A%84%E5%9B%9E%E5%A4%8D%EF%BC%8C%E6%88%91%E5%B0%87%E5%98%97%E8%A9%A6%E4%BD%BF%E7%94%A8%20%26lt%3B%26lt%3B%20Set%20Items()%20%E4%B8%A6%E6%AA%A2%E6%9F%A5%E5%AE%83%E6%98%AF%E5%90%A6%E6%AF%94%20%26lt%3B%26lt%3B%20%3CREMOVE%20all%3D%22%22%3E%3C%2FREMOVE%3E%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E9%97%9C%E6%96%BC%E9%A0%85%E7%9B%AE%E6%95%B8%E9%87%8F%EF%BC%8C%E5%A4%A7%E7%B4%84%E7%B4%84%E7%82%BA30k%EF%BC%8C%E5%A5%87%E6%80%AA%E7%9A%84%E6%98%AF%EF%BC%8C%E7%95%B6%E6%88%91%E5%8A%A0%E8%BC%89%E8%85%B3%E6%9C%AC%E6%99%82%EF%BC%8C%E5%BE%9E%E9%A0%AD%E9%96%8B%E5%A7%8B%E5%A1%AB%E5%85%85lb%20%E6%89%80%E9%9C%80%E7%9A%84%E6%99%82%E9%96%93%E8%A6%81%E5%B0%91%E5%BE%97%E5%A4%9A%EF%BC%8C%E7%84%B6%E5%BE%8C%E6%9B%B4%E6%96%B0%E5%85%A7%E5%AE%B9%E6%89%80%E9%9C%80%E7%9A%84%E6%99%82%E9%96%93%E8%A6%81%E5%B0%91%E5%BE%97%E5%A4%9A%EF%BC%8C%E6%88%91%E6%AD%A3%E5%9C%A8%E8%80%83%E6%85%AE%E4%BD%9C%E7%82%BA%E5%88%AA%E9%99%A4%E5%88%97%E8%A1%A8%E6%A1%86%E7%9A%84%E6%96%B9%E6%B3%95%E7%84%B6%E5%BE%8C%E5%86%8D%E6%AC%A1%E5%89%B5%E5%BB%BA%E5%AE%83%E5%80%91%EF%BC%8C%E4%BD%86%E5%9C%A8%E8%85%B3%E6%9C%AC%E4%B8%AD%E9%80%B2%E8%A1%8C%E6%89%80%E6%9C%89%E9%80%99%E4%BA%9B%E6%9B%B4%E6%94%B9%E5%8F%AF%E8%83%BD%E9%9D%9E%E5%B8%B8%E5%9B%B0%E9%9B%A3%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-749339%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E5%84%AA%E5%8C%96%E5%88%97%E9%8C%B6%E6%A1%86%E5%85%A7%E5%AE%B9%E6%9B%B4%E6%96%B0%E3%80%82%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-749339%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%88%91%E8%AA%8D%E7%82%BA%E9%80%99%E5%85%A9%E7%A8%AE%E6%96%B9%E6%B3%95%E9%83%BD%E6%84%9F%E8%A6%BA%E7%9B%B8%E7%95%B6%E5%BF%AB%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%0A%0Arowcount%20%3D%20100000%3B%0A%0Adt%20%3D%20New%20Table(%22Demo%22%2C%0A%09Add%20Rows(rowcount)%2C%0A%09New%20Column(%22Values%22%2C%20Character%2C%20Nominal%2C%20%26lt%3B%26lt%3B%20Set%20Each%20Value(%0A%09%09Hex(Row())%20%7C%7C%20Hex(Row())%20%7C%7C%20Hex(Row())%0A%09))%0A)%3B%0A%0Avalues%20%3D%20Column(dt%2C%201)%5Bdt%20%26lt%3B%26lt%3B%20get%20rows%20where(Excluded(Row%20State())%20!%3D%201)%5D%3B%0AClose(dt%2C%20no%20save)%3B%0A%0Anw%20%3D%20New%20Window(%22test%22%2C%0A%09H%20List%20Box(%0A%09%09H%20List%20Box(%0A%09%09%09lb1%20%3D%20List%20Box(values%2C%20nlines(10)%2C%20width(100))%2C%0A%09%09%09Button%20Box(%22reset%22%2C%20reset_lb1)%2C%09%09%09%0A%09%09)%0A%09)%2C%0A%09H%20List%20Box(%0A%09%09H%20List%20Box(%0A%09%09%09lb2_collector%20%3D%20V%20List%20Box(%0A%09%09%09%09lb2%20%3D%20List%20Box(values%2C%20nlines(10)%2C%20width(100))%2C%0A%09%09%09)%2C%0A%09%09%09Button%20Box(%22reset2%22%2C%20reset_lb2)%2C%09%09%09%0A%09%09)%0A%09)%0A)%3B%0A%09%0Areset_lb1%20%3D%20Expr(%0A%09start1%20%3D%20HP%20Time()%3B%0A%09lb1%20%26lt%3B%26lt%3B%20Set%20Items(values)%3B%0A%09end1%20%3D%20HP%20Time()%3B%0A%09start2%20%3D%20end1%3B%0A%09Nnames%20%3D%20N%20Items(values)%3B%0A%09For(i%20%3D%201%2C%20i%20%26lt%3B%3D%20Nnames%2C%20i%2B%2B%2C%0A%09%09lb1%20%26lt%3B%26lt%3B%20set%20selected(i)%3B%0A%09)%3B%0A%09end2%20%3D%20HP%20Time()%3B%0A%09Show((end1%20-%20start1)%2F1e6%2C%20(end2-start2)%2F1e6%2C%20(end2-start1)%2F1e6)%3B%0A)%3B%0A%0Areset_lb2%20%3D%20Expr(%0A%09start3%20%3D%20HP%20Time()%3B%0A%09vlb%20%3D%20V%20List%20Box(lb2%20%3D%20List%20Box(values%2C%20nlines(10)%2C%20width(100)))%3B%0A%09For%20Each(%7Bval%2C%20idx%7D%2C%20values%2C%0A%09%09lb2%20%26lt%3B%26lt%3B%20set%20selected(idx)%3B%0A%09)%3B%0A%09While(!IsEmpty(lb2_collector%20%26lt%3B%26lt%3B%20child)%2C%0A%09%09(lb2_collector%20%26lt%3B%26lt%3B%20child)%20%26lt%3B%26lt%3B%20delete%20box%3B%0A%09)%3B%0A%09lb2_collector%20%26lt%3B%26lt%3B%20Append(vlb)%3B%0A%09end3%20%3D%20HP%20Time()%3B%0A%09Show((end3%20-%20start3)%2F1e6)%3B%0A)%3B%0A%0AWrite()%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-749349%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E5%84%AA%E5%8C%96%E5%88%97%E9%8C%B6%E6%A1%86%E5%85%A7%E5%AE%B9%E6%9B%B4%E6%96%B0%E3%80%82%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-749349%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E9%9C%80%E8%A6%81%E6%B3%A8%E6%84%8F%E7%9A%84%E4%B8%80%E4%BB%B6%E4%BA%8B%E6%98%AF%20%26lt%3B%26lt%3B%20Set%20Selected%20%E5%B0%87%E9%A0%90%E8%A8%AD%E5%9F%B7%E8%A1%8C%E8%88%87%E5%88%97%E9%8C%B6%E6%A1%86%EF%BC%88%E5%A6%82%E6%9E%9C%E6%9C%89%EF%BC%89%E9%97%9C%E8%81%AF%E7%9A%84%E8%85%B3%E6%9C%AC%E3%80%82%E5%A6%82%E6%9E%9C%E6%82%A8%E6%9C%89%E8%88%87%E4%B9%8B%E9%97%9C%E8%81%AF%E7%9A%84%E8%85%B3%E6%9C%AC%EF%BC%8C%E4%BD%86%E4%B8%8D%E5%B8%8C%E6%9C%9B%E5%AE%83%E5%9C%A8%E6%AF%8F%E7%B5%84%E4%B8%AD%E8%A7%B8%E7%99%BC%EF%BC%8C%E8%AB%8B%E4%BD%BF%E7%94%A8%20%26lt%3B%26lt%3B%20Set%20Selected(idx%2C%201%2C%20Run%20Script(0))%20%EF%BC%88%E5%A6%82%E6%9E%9C%E9%9C%80%E8%A6%81%EF%BC%8C%E6%82%A8%E5%8F%AF%E4%BB%A5%E5%9C%A8%E6%9C%80%E5%BE%8C%E4%B8%80%E7%B5%84%E4%B8%8A%E8%A7%B8%E7%99%BC%E5%AE%83%EF%BC%89%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%0A%0Arowcount%20%3D%20100000%3B%0A%0Adt%20%3D%20New%20Table(%22Demo%22%2C%0A%09Add%20Rows(rowcount)%2C%0A%09New%20Column(%22Values%22%2C%20Character%2C%20Nominal%2C%20%26lt%3B%26lt%3B%20Set%20Each%20Value(%0A%09%09Hex(Row())%20%7C%7C%20Hex(Row())%20%7C%7C%20Hex(Row())%0A%09))%0A)%3B%0A%0Avalues%20%3D%20Column(dt%2C%201)%5Bdt%20%26lt%3B%26lt%3B%20get%20rows%20where(Excluded(Row%20State())%20!%3D%201)%5D%3B%0AClose(dt%2C%20no%20save)%3B%0A%0Anw%20%3D%20New%20Window(%22test%22%2C%0A%09H%20List%20Box(%0A%09%09lb2_collector%20%3D%20V%20List%20Box(%0A%09%09%09lb2%20%3D%20List%20Box(values%2C%20nlines(10)%2C%20width(100)%2C%20Show(1))%2C%0A%09%09)%2C%0A%09%09Button%20Box(%22reset2%22%2C%20reset_lb2)%2C%09%09%09%0A%09)%0A)%3B%0A%09%0Areset_lb2%20%3D%20Expr(%0A%09start3%20%3D%20HP%20Time()%3B%0A%09vlb%20%3D%20V%20List%20Box(lb2%20%3D%20List%20Box(values%2C%20nlines(10)%2C%20width(100)%2C%20Show(1)))%3B%0A%09For(i%20%3D%201%2C%20i%20%26lt%3B%20N%20Items(values)%2C%20i%2B%2B%2C%0A%09%09lb2%20%26lt%3B%26lt%3B%20set%20selected(i%2C%201%2C%20Run%20Script(0))%3B%0A%09)%3B%0A%09lb2%20%26lt%3B%26lt%3B%20set%20selected(N%20Items(values)%2C%201%2C%20Run%20Script(1))%3B%0A%0A%09While(!IsEmpty(lb2_collector%20%26lt%3B%26lt%3B%20child)%2C%0A%09%09(lb2_collector%20%26lt%3B%26lt%3B%20child)%20%26lt%3B%26lt%3B%20delete%20box%3B%0A%09)%3B%0A%09lb2_collector%20%26lt%3B%26lt%3B%20Append(vlb)%3B%0A%09end3%20%3D%20HP%20Time()%3B%0A%09Show((end3%20-%20start3)%2F1e6)%3B%0A)%3B%0A%0AWrite()%3B%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-749353%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E5%84%AA%E5%8C%96%E5%88%97%E9%8C%B6%E6%A1%86%E5%85%A7%E5%AE%B9%E6%9B%B4%E6%96%B0%E3%80%82%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-749353%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E9%9D%9E%E5%B8%B8%E6%84%9F%E8%AC%9D%E6%82%A8%E7%9A%84%E6%BC%94%E7%A4%BA%E3%80%82%E5%9C%A8%E6%88%91%E7%9A%84%E6%A9%9F%E5%99%A8%E4%B8%8A%EF%BC%8C%E7%AC%AC%E4%BA%8C%E7%A8%AE%E6%96%B9%E6%B3%95%E5%A4%A7%E7%B4%84%E5%BF%AB%205%20%E5%80%8D%EF%BC%8C%E6%AD%A3%E5%A6%82%E6%82%A8%E6%89%80%E7%9C%8B%E5%88%B0%E7%9A%84%EF%BC%8C%E7%AC%AC%E4%B8%80%E7%A8%AE%E6%96%B9%E6%B3%95%E7%9A%84%E5%A4%A7%E9%83%A8%E5%88%86%E6%99%82%E9%96%93%E9%83%BD%E8%8A%B1%E5%9C%A8%E4%BA%86%E8%A8%AD%E5%AE%9A%E7%9A%84%E9%81%B8%E5%AE%9A%E5%BE%AA%E7%92%B0%E4%B8%8A%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar

Optimizing list box content update.

Hello JMP community,

 

Lately, I was looking into improve the performance of my internal JSL scripts and I found the following performance issues that I would like to address.

Lets take the following script (JMP 17.2 PRO running on macOS):

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

values = Column( dt, 1 )[dt << get rows where( Excluded( Row State() ) != 1 )];
new window("test", 
	lb = list box( values, nlines(10), width(100), ),
	b = button box("reset", reset_lb),
	);
	
reset_lb = expr(
	lb << remove all();
	lb << append(values);
	
	Nnames = N Items(values);
	for(i = 1, i <= Nnames, i++,
		lb << set selected(i);
	);
);

In some of my scripts I am using list boxes that are dynamically updated. For changing the content of the list boxes I use the << remove() and << append() functions, they work just fine but I am afraid that this method does not scale very well with the number of rows, another portion that surprisingly runs really slow is the for loop with << set selected(), apparently this is the only method that I could find for selecting all the items in a list box but it scales terribly with the number of rows.

 

My questions is if there are any best known ways to update the content of the list boxes that is not slow performance wise. I am looking for possible alternatives that would do:

  1. optimal method to set the content of the list box.
  2. fast way to select all the items of the list box.

Any feedback or suggestions would be greatly appreciated.

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Optimizing list box content update.

Both of these methods feel fairly fast in my opinion

Names Default To Here(1);

rowcount = 100000;

dt = New Table("Demo",
	Add Rows(rowcount),
	New Column("Values", Character, Nominal, << Set Each Value(
		Hex(Row()) || Hex(Row()) || Hex(Row())
	))
);

values = Column(dt, 1)[dt << get rows where(Excluded(Row State()) != 1)];
Close(dt, no save);

nw = New Window("test",
	H List Box(
		H List Box(
			lb1 = List Box(values, nlines(10), width(100)),
			Button Box("reset", reset_lb1),			
		)
	),
	H List Box(
		H List Box(
			lb2_collector = V List Box(
				lb2 = List Box(values, nlines(10), width(100)),
			),
			Button Box("reset2", reset_lb2),			
		)
	)
);
	
reset_lb1 = Expr(
	start1 = HP Time();
	lb1 << Set Items(values);
	end1 = HP Time();
	start2 = end1;
	Nnames = N Items(values);
	For(i = 1, i <= Nnames, i++,
		lb1 << set selected(i);
	);
	end2 = HP Time();
	Show((end1 - start1)/1e6, (end2-start2)/1e6, (end2-start1)/1e6);
);

reset_lb2 = Expr(
	start3 = HP Time();
	vlb = V List Box(lb2 = List Box(values, nlines(10), width(100)));
	For Each({val, idx}, values,
		lb2 << set selected(idx);
	);
	While(!IsEmpty(lb2_collector << child),
		(lb2_collector << child) << delete box;
	);
	lb2_collector << Append(vlb);
	end3 = HP Time();
	Show((end3 - start3)/1e6);
);

Write();
-Jarmo

View solution in original post

5 REPLIES 5
jthi
Super User

Re: Optimizing list box content update.

How many items are you expecting to have in the list box? For 1 there is << Set Items() you can use 

 

Edit:

-Jarmo

Re: Optimizing list box content update.

Hello Jarmo,

 

Thanks for the reply, I will try to use << Set Items() and will check if it is faster then <<remove all(), << append().

 

Regarding the number of items, it is about around ~30k, the strange thing is when I load the script it takes much less to populate the lb from scratch then it takes to update contents, I was thinking as a method to delete the list boxes and then create them again but it might be quite difficult to do all these changes in the scripts.

jthi
Super User

Re: Optimizing list box content update.

Both of these methods feel fairly fast in my opinion

Names Default To Here(1);

rowcount = 100000;

dt = New Table("Demo",
	Add Rows(rowcount),
	New Column("Values", Character, Nominal, << Set Each Value(
		Hex(Row()) || Hex(Row()) || Hex(Row())
	))
);

values = Column(dt, 1)[dt << get rows where(Excluded(Row State()) != 1)];
Close(dt, no save);

nw = New Window("test",
	H List Box(
		H List Box(
			lb1 = List Box(values, nlines(10), width(100)),
			Button Box("reset", reset_lb1),			
		)
	),
	H List Box(
		H List Box(
			lb2_collector = V List Box(
				lb2 = List Box(values, nlines(10), width(100)),
			),
			Button Box("reset2", reset_lb2),			
		)
	)
);
	
reset_lb1 = Expr(
	start1 = HP Time();
	lb1 << Set Items(values);
	end1 = HP Time();
	start2 = end1;
	Nnames = N Items(values);
	For(i = 1, i <= Nnames, i++,
		lb1 << set selected(i);
	);
	end2 = HP Time();
	Show((end1 - start1)/1e6, (end2-start2)/1e6, (end2-start1)/1e6);
);

reset_lb2 = Expr(
	start3 = HP Time();
	vlb = V List Box(lb2 = List Box(values, nlines(10), width(100)));
	For Each({val, idx}, values,
		lb2 << set selected(idx);
	);
	While(!IsEmpty(lb2_collector << child),
		(lb2_collector << child) << delete box;
	);
	lb2_collector << Append(vlb);
	end3 = HP Time();
	Show((end3 - start3)/1e6);
);

Write();
-Jarmo
jthi
Super User

Re: Optimizing list box content update.

One thing to note is that << Set Selected will run script associated with list box (if there is one) by default. If you have script associated with it but don't want it to trigger with each set, use << Set Selected(idx, 1, Run Script(0)) (you can trigger it on last set if you need to)

Names Default To Here(1);

rowcount = 100000;

dt = New Table("Demo",
	Add Rows(rowcount),
	New Column("Values", Character, Nominal, << Set Each Value(
		Hex(Row()) || Hex(Row()) || Hex(Row())
	))
);

values = Column(dt, 1)[dt << get rows where(Excluded(Row State()) != 1)];
Close(dt, no save);

nw = New Window("test",
	H List Box(
		lb2_collector = V List Box(
			lb2 = List Box(values, nlines(10), width(100), Show(1)),
		),
		Button Box("reset2", reset_lb2),			
	)
);
	
reset_lb2 = Expr(
	start3 = HP Time();
	vlb = V List Box(lb2 = List Box(values, nlines(10), width(100), Show(1)));
	For(i = 1, i < N Items(values), i++,
		lb2 << set selected(i, 1, Run Script(0));
	);
	lb2 << set selected(N Items(values), 1, Run Script(1));

	While(!IsEmpty(lb2_collector << child),
		(lb2_collector << child) << delete box;
	);
	lb2_collector << Append(vlb);
	end3 = HP Time();
	Show((end3 - start3)/1e6);
);

Write();

 

-Jarmo

Re: Optimizing list box content update.

Thanks a lot for demonstration. On my machine the second method is around 5x faster, and as you can see most of the time from first method is spent for the set selected loop.