cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-108879%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%A6%82%E4%BD%95%E7%B4%A2%E5%BC%95%E5%88%B0%E5%A4%8D%E9%80%89%E6%A1%86%E8%A1%A8%E6%A1%86%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-108879%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E5%85%A8%E9%83%A8%EF%BC%8C%3CBR%20%2F%3E%E6%88%91%E6%9C%89%E4%B8%80%E4%B8%AA%E7%94%B1%20n%20%E4%B8%AA%E5%A4%8D%E9%80%89%E6%A1%86%E7%BB%84%E6%88%90%E7%9A%84%E8%A1%A8%E6%A1%86%E3%80%82%20%E6%88%91%E6%83%B3%E7%9F%A5%E9%81%93%E5%A6%82%E4%BD%95%E9%80%89%E6%8B%A9%E5%85%B6%E4%B8%AD%E7%9A%84%E4%B8%80%E4%BA%9B%E3%80%82%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%20%20%20%20%20%20%20%20%20%20LB_b%20%3D%20Lineup%20Box(N%20Col(1))%3B%20%0A%20%20%20nR%20%3D%2010%3B%0A%20%20%20nC%20%3D%2010%3B%0A%20%20%20SCB1%20%3D%20String%20Col%20Box(%20%22%22%2C%20%7B%7D%20)%3B%20%0A%20%20%20For(%20i%20%3D%201%2C%20i%20%26lt%3B%3D%20nR%2C%20i%2B%2B%2C%0A%20%20%20SCB1%20%26lt%3B%26lt%3B%20Add%20Element(%20Char(%20i%20)%20)%0A%20%20%20)%3B%0A%20%20%20TB1%20%3D%20Table%20Box(%20SCB1%20)%3B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20For(%20i%20%3D%201%2C%20i%20%26lt%3B%3D%20nC%2C%20i%2B%2B%2C%0A%20%20%20Insert%20Into(%20TB1%2C%20Check%20Box(%20Repeat(%20%7B%22%20%22%7D%2C%20nR%20)%2C%20%26lt%3B%3CSET%20heading%3D%22%22%3E%3C%2FSET%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%E5%BD%93%E6%88%91%E6%9F%A5%E7%9C%8B%E6%A0%91%E7%BB%93%E6%9E%84%E6%97%B6%EF%BC%8C%E6%88%91%E6%83%B3%E7%9F%A5%E9%81%93%E4%B8%BA%E4%BB%80%E4%B9%88%E6%88%91%E6%97%A0%E6%B3%95%E8%AE%BF%E9%97%AE%E5%85%83%E7%B4%A0%E3%80%82%20%E6%88%91%E5%B0%9D%E8%AF%95%E4%BA%86%E7%B1%BB%E4%BC%BC%E4%BB%A5%E4%B8%8B%E7%9A%84%E6%93%8D%E4%BD%9C%EF%BC%8C%E4%BD%86%E6%B2%A1%E6%9C%89%E6%88%90%E5%8A%9F%E3%80%82%20%E6%AD%A4%E5%A4%96%EF%BC%8C%E7%9B%AE%E6%A0%87%E4%B8%8D%E6%98%AF%E8%83%BD%E5%A4%9F%E9%80%89%E6%8B%A9%E4%B8%80%E5%88%97%E5%A4%8D%E9%80%89%E6%A1%86%EF%BC%8C%E8%80%8C%E6%98%AF%E8%83%BD%E5%A4%9F%E9%80%89%E6%8B%A9%E7%9F%A9%E9%98%B5%E4%B8%AD%E7%9A%84%E5%8D%95%E4%B8%AA%E5%A4%8D%E9%80%89%E6%A1%86%E3%80%82%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ETB1%5B%22CheckBoxBox(1)%22%5D%20%26lt%3B%26lt%3B%20select%20%3B%20%3CBR%20%2F%3E%3C%2FCODE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-108906%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E5%A6%82%E4%BD%95%E7%B4%A2%E5%BC%95%E5%A4%8D%E9%80%89%E6%A1%86%E8%A1%A8%E6%A1%86%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-108906%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E6%AD%A4%E4%BB%A3%E7%A0%81%E5%B0%86%E4%BB%8E%E4%BF%9D%E5%AD%98%E7%9A%84%201%20%E5%92%8C%200%20%E7%9F%A9%E9%98%B5%E4%B8%AD%E8%AE%BE%E7%BD%AE%E5%A4%8D%E9%80%89%E6%A1%86%E3%80%82%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%2F%2F%20Set%20some%20random%20values%20in%20this%20matrix%0Asaved_cbmat%20%3D%20%0A%5B%201%200%200%201%200%200%200%200%200%200%2C%20%0A%200%200%200%200%200%200%200%200%200%200%2C%20%0A%200%201%200%200%200%200%200%200%200%200%2C%20%0A%200%201%200%200%200%200%201%200%200%200%2C%20%0A%200%201%200%201%200%200%201%200%201%200%2C%20%0A%200%200%200%200%200%200%200%200%200%201%2C%20%0A%200%200%200%200%200%200%200%200%201%201%2C%20%0A%200%200%200%200%200%200%200%200%201%200%2C%20%0A%200%200%200%200%200%200%200%200%201%200%2C%20%0A%200%200%200%200%200%200%200%200%200%200%5D%3B%0A%0An%20%3D%2010%3B%20%20%2F%2F%20%23%20rows%0Am%20%3D%2010%3B%20%20%2F%2F%20%23%20cols%0Aa%20%3D%201%3A%3An%3B%0A%0A%2F%2F%20Create%20a%20list%20of%20empty%20text%20fields%20as%20checkbox%20labels%0Acb_list%20%3D%20%7B%7D%3B%0Afor%20(i%20%3D%201%2C%20i%20%26lt%3B%3D%20n%2C%20i%2B%2B%2C%0A%20cb_list%5Bi%5D%20%3D%20%22%22%3B%0A)%3B%0A%0A%0Acbmat%20%3D%20j(n%2C%20m%2C%200)%3B%0A%2F%2F%20Create%20the%20window%0Anw%20%3D%20new%20window(%22Test%22%2C%0A%20tb%20%3D%20table%20box(%0A%20%20ncb%20%3D%20number%20col%20box(%22%22%2C%20a)%2C%0A%20)%2C%0A%20okb%20%3D%20button%20box(%22OK%22%2C%0A%20%20for%20(i%20%3D%201%2C%20i%20%26lt%3B%3D%20m%2C%20i%2B%2B%2C%0A%20%20%20for%20(k%20%3D%201%2C%20k%20%26lt%3B%3D%20n%2C%20k%2B%2B%2C%0A%20%20%20%20cbmat%5Bk%2C%20i%5D%20%3D%20cb%5Bi%5D%20%26lt%3B%26lt%3B%20get(k)%3B%0A%20%20%20)%2C%0A%20%20)%3B%0A%20%20show(cbmat)%3B%0A%20%20nw%20%26lt%3B%26lt%3B%20close%20window%3B%0A%20)%2C%0A)%3B%0A%0A%2F%2F%20Create%20an%20array%20of%20checkbox%20columns%0Acb%20%3D%20%7B%7D%3B%0A%2F%2F%20Add%20the%20checkboxes%0Afor%20(i%20%3D%201%2C%20i%20%26lt%3B%3D%20m%2C%20i%2B%2B%2C%0A%20cb%5Bi%5D%20%3D%20checkbox(cb_list)%3B%0A%20cb%5Bi%5D%20%26lt%3B%26lt%3B%20set%20heading(char(i))%3B%0A%20tb%20%26lt%3B%26lt%3B%20append(cb%5Bi%5D)%3B%0A)%3B%0A%0A%2F%2F%20Preload%20the%20checkboxes%20from%20the%20saved%20matrix%0Afor%20(i%20%3D%201%2C%20i%20%26lt%3B%3D%20m%2C%20i%2B%2B%2C%0A%20for%20(k%20%3D%201%2C%20k%20%26lt%3B%3D%20n%2C%20k%2B%2B%2C%0A%20%20on_off%20%3D%20saved_cbmat%5Bk%2C%20i%5D%3B%0A%20%20cb%5Bi%5D%20%26lt%3B%26lt%3B%20set(k%2C%20on_off)%3B%0A%20)%2C%0A)%3B%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-108896%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E5%A6%82%E4%BD%95%E7%B4%A2%E5%BC%95%E5%A4%8D%E9%80%89%E6%A1%86%E8%A1%A8%E6%A1%86%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-108896%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F4550%22%20target%3D%22_blank%22%3E%40pmroz%3C%2FA%3E%E5%92%8C%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F2687%22%20target%3D%22_blank%22%3E%40tx%E5%B0%BC%E5%B0%94%E6%A3%AE%3C%2FA%3E%2C%3CBR%20%2F%3E%E8%B0%A2%E8%B0%A2%E4%BD%A0%E7%9A%84%E5%9B%9E%E5%A4%8D%E3%80%82%20%E4%BD%86%E6%98%AF%EF%BC%8C%E5%A6%82%E6%9E%9C%E5%8F%AF%E4%BB%A5%E7%9A%84%E8%AF%9D%EF%BC%8C%E6%88%91%E8%AE%A4%E4%B8%BA%E6%88%91%E7%9A%84%E9%97%AE%E9%A2%98%E7%9A%84%E4%B8%BB%E8%A6%81%E9%83%A8%E5%88%86%EF%BC%8C%E5%8D%B3%E5%A6%82%E4%BD%95%E5%B0%86%E5%AE%83%E4%BB%AC%E8%AE%BE%E7%BD%AE%E4%B8%BA%E9%80%89%E4%B8%AD%EF%BC%88%E6%88%91%E7%9A%84%E5%9D%8F%E5%A4%84%20-%20%E6%88%91%E5%BA%94%E8%AF%A5%E8%A6%81%E6%B1%82%E6%A3%80%E6%9F%A5%EF%BC%89%E4%BC%BC%E4%B9%8E%E6%B2%A1%E6%9C%89%E5%BE%97%E5%88%B0%E8%A7%A3%E5%86%B3%E3%80%82%20%E4%BD%A0%E4%BB%AC%E4%B8%AD%E7%9A%84%E4%BB%BB%E4%BD%95%E4%B8%80%E4%B8%AA%E4%BA%BA%E9%83%BD%E5%8F%AF%E4%BB%A5%E6%8C%87%E5%AF%BC%E6%88%91%E5%A6%82%E4%BD%95%E9%80%89%E4%B8%AD%E4%BB%BB%E4%BD%95%E5%A4%8D%E9%80%89%E6%A1%86%E5%90%97%EF%BC%9F%3C%2FP%3E%3CP%3E%E6%88%91%E8%AE%A4%E4%B8%BA%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F4550%22%20target%3D%22_blank%22%3E%40pmroz%3C%2FA%3E%E7%9A%84%E5%93%8D%E5%BA%94%E6%8F%90%E4%BE%9B%E4%BA%86%E4%B8%80%E7%A7%8D%E5%AF%B9%E5%A4%8D%E9%80%89%E6%A1%86%E8%BF%9B%E8%A1%8C%E7%B4%A2%E5%BC%95%E7%9A%84%E6%96%B9%E6%B3%95%EF%BC%8C%E4%BD%86%E6%88%91%E8%AE%A4%E4%B8%BA%E5%AE%83%E6%98%AF%E6%8C%89%E5%88%97%E5%BC%95%E7%94%A8%E5%AE%83%E4%BB%AC%EF%BC%8C%E8%80%8C%E4%B8%8D%E6%98%AF%E6%8C%89%E6%AF%8F%E4%B8%AA%E5%8D%95%E7%8B%AC%E7%9A%84%E5%A4%8D%E9%80%89%E6%A1%86%E5%BC%95%E7%94%A8%E5%AE%83%E4%BB%AC%E3%80%82%20%E6%88%91%E5%B0%86%E5%B0%9D%E8%AF%95%E6%9B%B4%E8%AF%A6%E7%BB%86%E5%9C%B0%E8%AF%B4%E6%98%8E%E6%88%91%E6%89%80%E5%AF%BB%E6%B1%82%E7%9A%84%E5%86%85%E5%AE%B9%EF%BC%9A%3C%2FP%3E%3CP%3E%E6%88%91%E5%8F%91%E5%B8%83%E7%9A%84%E4%BB%A3%E7%A0%81%E7%89%87%E6%AE%B5%E4%B8%BA%E6%88%91%E6%8F%90%E4%BE%9B%E4%BA%86%E4%B8%80%E4%B8%AA%E5%8F%AF%E9%80%89%E5%A4%8D%E9%80%89%E6%A1%86%E7%9A%84%E7%9F%A9%E9%98%B5%EF%BC%8C%E5%A6%82%E4%B8%8B%E6%89%80%E7%A4%BA%EF%BC%9A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20457px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20457px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20457px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F15408i6C571F9BCB542615%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E7%8E%B0%E5%9C%A8%EF%BC%8C%E5%A6%82%E6%9E%9C%E7%94%A8%E6%88%B7%E5%81%9A%E5%87%BA%E9%80%89%E6%8B%A9%EF%BC%8C%E6%88%91%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%E4%BB%A5%E4%B8%8B%E5%91%BD%E4%BB%A4%E5%8D%B8%E8%BD%BD%E9%80%89%E6%8B%A9%EF%BC%9A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENW%20%3D%20New%20Window(%22Test%22%2C%0A%20%20%20%20%20VLB0%20%3D%20V%20List%20Box(Align(center)%2C%0A%20%20%20%20%20%20%20%20%20%20%20LB_b%0A%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20)%3B%20%0AVLB0%20%26lt%3B%26lt%3B%20Append(%0A%20%20%20%20H%20List%20Box(%0A%20%20%20%20%20%20%20%20BB_TargetMatrix%20%3D%20Button%20Box(%20%22OK%22%2C%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ResMat%20%3D%20%7B%7D%3B%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20loop%20through%20each%20row%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20For(%20i%20%3D%201%2C%20i%20%26lt%3B%3D%20nR%2C%20i%2B%2B%2C%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ResMat%5Bi%5D%20%3D%20%7B%7D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20loop%20through%20each%20column%20getting%20values%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20For(%20r%20%3D%201%2C%20r%20%26lt%3B%3D%20nC%2C%20r%2B%2B%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ResMat%5Bi%5D%5Br%5D%20%3D%20TB1%5BCheckBoxBox(%20r%20)%5D%20%26lt%3B%26lt%3B%20get(%20i%20)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%3B%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%3B%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ResMat%20%3D%20Matrix(%20ResMat%20)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%2F%2F%20end%20of%20button%20box%20%0A%20%20%20%20%20%20%20%20)%2F%2F%20end%20of%20H%20List%20Box%20%0A%20%20%20%20%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20318px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20318px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20318px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F15409iFD01D43F7113D24F%2Fimage-dimensions%2F318x469%3Fv%3Dv2%22%20width%3D%22318%22%20height%3D%22469%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%3CP%3E%E4%BD%86%E6%98%AF%EF%BC%8C%E6%88%91%E6%83%B3%E7%9F%A5%E9%81%93%E5%A6%82%E4%BD%95%E5%9C%A8%E8%A1%A8%E6%A0%BC%E6%A1%86%E4%B8%AD%E9%A2%84%E5%85%88%E9%80%89%E4%B8%AD%E4%B8%80%E4%BA%9B%E5%A4%8D%E9%80%89%E6%A1%86%E3%80%82%20%E6%88%91%E6%9C%89%E4%B8%80%E4%B8%AA%E4%B8%8E%E8%A1%A8%E6%A0%BC%E6%A1%86%E5%A4%A7%E5%B0%8F%E7%9B%B8%E5%90%8C%E7%9A%84%E7%9F%A9%E9%98%B5%EF%BC%8C%E6%88%91%E6%83%B3%E7%94%A8%E5%AE%83%E6%9D%A5%E8%AE%BE%E7%BD%AE%E9%80%89%E4%B8%AD%E7%9A%84%E5%A4%8D%E9%80%89%E6%A1%86%E3%80%82%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-108883%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E5%A6%82%E4%BD%95%E7%B4%A2%E5%BC%95%E5%A4%8D%E9%80%89%E6%A1%86%E8%A1%A8%E6%A1%86%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-108883%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E8%BF%99%E6%98%AF%E4%B8%80%E7%A7%8D%E6%89%A7%E8%A1%8C%E6%82%A8%E9%9C%80%E8%A6%81%E7%9A%84%E6%96%B9%E6%B3%95%EF%BC%9A%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3En%20%3D%2010%3B%20%20%2F%2F%20%23%20rows%0Am%20%3D%2010%3B%20%20%2F%2F%20%23%20cols%0Aa%20%3D%201%3A%3An%3B%0A%0A%2F%2F%20Create%20a%20list%20of%20empty%20text%20fields%20as%20checkbox%20labels%0Acb_list%20%3D%20%7B%7D%3B%0Afor%20(i%20%3D%201%2C%20i%20%26lt%3B%3D%20n%2C%20i%2B%2B%2C%0A%20cb_list%5Bi%5D%20%3D%20%22%22%3B%0A)%3B%0A%0A%0Acbmat%20%3D%20j(n%2C%20m%2C%200)%3B%0A%2F%2F%20Create%20the%20window%0Anw%20%3D%20new%20window(%22Test%22%2C%0A%20tb%20%3D%20table%20box(%0A%20%20ncb%20%3D%20number%20col%20box(%22%22%2C%20a)%2C%0A%20)%2C%0A%20okb%20%3D%20button%20box(%22OK%22%2C%0A%20%20for%20(i%20%3D%201%2C%20i%20%26lt%3B%3D%20m%2C%20i%2B%2B%2C%0A%20%20%20for%20(k%20%3D%201%2C%20k%20%26lt%3B%3D%20n%2C%20k%2B%2B%2C%0A%20%20%20%20cbmat%5Bk%2C%20i%5D%20%3D%20cb%5Bi%5D%20%26lt%3B%26lt%3B%20get(k)%3B%0A%20%20%20)%2C%0A%20%20)%3B%0A%20%20show(cbmat)%3B%0A%20%20nw%20%26lt%3B%26lt%3B%20close%20window%3B%0A%20)%2C%0A)%3B%0A%0A%2F%2F%20Create%20an%20array%20of%20checkbox%20columns%0Acb%20%3D%20%7B%7D%3B%0A%2F%2F%20Add%20the%20checkboxes%0Afor%20(i%20%3D%201%2C%20i%20%26lt%3B%3D%20m%2C%20i%2B%2B%2C%0A%20cb%5Bi%5D%20%3D%20checkbox(cb_list)%3B%0A%20cb%5Bi%5D%20%26lt%3B%26lt%3B%20set%20heading(char(i))%3B%0A%20tb%20%26lt%3B%26lt%3B%20append(cb%5Bi%5D)%3B%0A)%3B%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22checkbox_matrix.png%22%20style%3D%22width%3A%20287px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22checkbox_matrix.png%22%20style%3D%22width%3A%20287px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22checkbox_matrix.png%22%20style%3D%22width%3A%20287px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F15407iE3352F199BAA06F2%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22checkbox_matrix.png%22%20alt%3D%22checkbox_matrix.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%3Ecbmat%20%3D%20%0A%5B%201%200%200%200%200%200%200%200%200%200%2C%20%0A%201%200%200%200%200%200%200%200%200%200%2C%20%0A%201%200%201%200%200%200%200%200%200%200%2C%20%0A%200%200%201%200%200%200%200%200%200%200%2C%20%0A%200%200%201%200%201%200%200%200%200%200%2C%20%0A%200%200%200%200%201%200%201%200%200%200%2C%20%0A%200%200%200%200%200%200%201%200%200%200%2C%20%0A%200%200%200%200%200%200%201%200%200%200%2C%20%0A%200%200%200%200%200%200%200%200%200%200%2C%20%0A%200%200%200%200%200%200%200%200%200%200%5D%3B%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-108881%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E5%A6%82%E4%BD%95%E7%B4%A2%E5%BC%95%E5%A4%8D%E9%80%89%E6%A1%86%E8%A1%A8%E6%A1%86%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-108881%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E6%82%A8%E6%9C%89%202%20%E4%B8%AA%E5%8F%82%E8%80%83%E9%97%AE%E9%A2%98%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ETB1%5B%22CheckBoxBox(1)%22%5D%20%26lt%3B%26lt%3B%20select%20%3B%20%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%E7%AC%AC%E4%B8%80%E4%B8%AA%E6%98%AF%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ETB1%5B%22CheckBoxBox(1)%22%5D%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%E6%AD%A3%E5%9C%A8%E5%AF%BB%E6%89%BE%E6%A0%87%E9%A2%98%E4%B8%BA%E2%80%9CCheckBoxBox()%E2%80%9D%E7%9A%84%E5%A4%A7%E7%BA%B2%E6%A1%86%E3%80%82%E4%B9%9F%E5%B0%B1%E6%98%AF%E8%AF%B4%EF%BC%8C%E6%82%A8%E5%B7%B2%E5%B0%86%E2%80%9CCheckBoxBox()%E2%80%9D%E6%94%BE%E5%9C%A8%E5%BC%95%E5%8F%B7%E4%B8%AD%EF%BC%8C%E5%B9%B6%E4%B8%94%E5%AE%83%E4%B8%8D%E6%98%AF%E5%9C%A8%E5%AF%BB%E6%89%BE%20CheckBoxBox()%20%E5%AF%B9%E8%B1%A1%EF%BC%8C%E8%80%8C%E6%98%AF%E5%9C%A8%E5%AF%BB%E6%89%BE%E6%A0%87%E9%A2%98%E4%B8%BA%E2%80%9CCheckBoxBox(1)%E2%80%9D%E7%9A%84%E5%AF%B9%E8%B1%A1%E3%80%82%20%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%E7%AC%AC%E4%BA%8C%EF%BC%8C%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%26lt%3B%26lt%3B%20Select%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%E4%B8%8D%E6%98%AF%20CheckBoxBox()%20%E5%8F%AF%E7%94%A8%E7%9A%84%E6%B6%88%E6%81%AF%E3%80%82%20%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ETB1%5BCheckBoxBox(1)%5D%20%26lt%3B%26lt%3B%20%20get%20selected%20%3B%20%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20transparent%3B%20color%3A%20%23000000%3B%20direction%3A%20ltr%3B%20font-family%3A%20Consolas%2CMonaco%2C'Andale%20Mono'%2C'Ubuntu%20Mono'%2Cmonospace%3B%20font-size%3A%2014px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20line-height%3A%2021px%3B%20-ms-hyphens%3A%20none%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-shadow%3A%200px%201px%20white%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20pre%3B%20word-break%3A%20normal%3B%20word-spacing%3A%200px%3B%20word-wrap%3A%20normal%3B%22%3E%E5%B0%86%E6%98%AF%E6%82%A8%E6%83%B3%E8%A6%81%E7%9A%84%EF%BC%8C%E9%99%A4%E4%BA%86%20%26lt%3B%26lt%3B%20get%20selected%20%E8%BF%94%E5%9B%9E%E6%AF%8F%E4%B8%AA%E9%80%89%E5%AE%9A%E5%A4%8D%E9%80%89%E6%A1%86%E7%9A%84%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%80%BC%EF%BC%8C%E5%B9%B6%E4%B8%94%E7%94%B1%E4%BA%8E%E5%A4%8D%E9%80%89%E6%A1%86%E7%9A%84%E6%89%80%E6%9C%89%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%80%BC%E9%83%BD%E8%AE%BE%E7%BD%AE%E4%B8%BA%E2%80%9C%E2%80%9D%EF%BC%8C%E8%BF%99%E5%B0%86%E6%98%AF%E6%82%A8%E6%89%80%E8%A6%81%E5%81%9A%E7%9A%84%E8%A2%AB%E9%80%80%E5%9B%9E%E3%80%82%20%E5%9B%A0%E6%AD%A4%EF%BC%8C%E6%82%A8%E9%9C%80%E8%A6%81%E5%81%9A%E7%9A%84%E6%98%AF%E5%BE%AA%E7%8E%AF%E9%81%8D%E5%8E%86%E6%AF%8F%E4%B8%AA%E5%A4%8D%E9%80%89%E6%A1%86%E5%B9%B6%E6%89%BE%E5%88%B0%E5%80%BC%E3%80%82%20%E8%BF%99%E6%98%AF%E4%B8%80%E4%B8%AA%E7%AE%80%E5%8D%95%E7%9A%84%E4%BE%8B%E5%AD%90%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EFor(%20c%20%3D%201%2C%20c%20%26lt%3B%3D%2010%2C%20c%2B%2B%2C%0A%20For(%20r%20%3D%201%2C%20r%20%26lt%3B%3D%2010%2C%20r%2B%2B%2C%0A%20%20If(%20T%5BCheckBoxBox(%20c%20)%5D%20%26lt%3B%26lt%3B%20get(%20r%20)%20%3D%3D%201%2C%0A%20%20%20Show(%20c%2C%20r%20)%0A%20%20)%0A%20)%0A)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
uday_guntupalli
Level VIII

How to index into a table box of check boxes

All, 
      I have a m by n Table box of check boxes. I am wondering, how I can set some of them selected. 

     

 

          LB_b = Lineup Box(N Col(1)); 
	  nR = 10;
	  nC = 10;
	  SCB1 = String Col Box( "", {} ); 
	  For( i = 1, i <= nR, i++,
			SCB1 << Add Element( Char( i ) )
		 );
	  TB1 = Table Box( SCB1 ); 																																						
	  For( i = 1, i <= nC, i++,
			Insert Into( TB1, Check Box( Repeat( {" "}, nR ), <<Set Heading( Char( i ) ) ) )
		 );				
	  LB_b << Append(TB1);
	  
	  T = New Window("Test",TB1);

        When I look at the tree structure, I wonder why I am unable to access the elements. I tried  something like the following  with no luck. Also, the goal is not to be able to select a column of check boxes, but a single checkbox in the matrix. 

 

        

TB1["CheckBoxBox(1)"] << select ; 

 

Best
Uday
1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: How to index into a table box of check boxes

This code will set the checkboxes from a saved matrix of 1s and 0s.

// Set some random values in this matrix
saved_cbmat = 
[	1 0 0 1 0 0 0 0 0 0, 
	0 0 0 0 0 0 0 0 0 0, 
	0 1 0 0 0 0 0 0 0 0, 
	0 1 0 0 0 0 1 0 0 0, 
	0 1 0 1 0 0 1 0 1 0, 
	0 0 0 0 0 0 0 0 0 1, 
	0 0 0 0 0 0 0 0 1 1, 
	0 0 0 0 0 0 0 0 1 0, 
	0 0 0 0 0 0 0 0 1 0, 
	0 0 0 0 0 0 0 0 0 0];

n = 10;		// # rows
m = 10;		// # cols
a = 1::n;

// Create a list of empty text fields as checkbox labels
cb_list = {};
for (i = 1, i <= n, i++,
	cb_list[i] = "";
);


cbmat = j(n, m, 0);
// Create the window
nw = new window("Test",
	tb = table box(
		ncb = number col box("", a),
	),
	okb = button box("OK",
		for (i = 1, i <= m, i++,
			for (k = 1, k <= n, k++,
				cbmat[k, i] = cb[i] << get(k);
			),
		);
		show(cbmat);
		nw << close window;
	),
);

// Create an array of checkbox columns
cb = {};
// Add the checkboxes
for (i = 1, i <= m, i++,
	cb[i] = checkbox(cb_list);
	cb[i] << set heading(char(i));
	tb << append(cb[i]);
);

// Preload the checkboxes from the saved matrix
for (i = 1, i <= m, i++,
	for (k = 1, k <= n, k++,
		on_off = saved_cbmat[k, i];
		cb[i] << set(k, on_off);
	),
);

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: How to index into a table box of check boxes

You have 2 reference issues with

TB1["CheckBoxBox(1)"] << select ; 

The first is that 

TB1["CheckBoxBox(1)"]

is looking for an Outline Box with the title "CheckBoxBox()".  That is, you have placed "CheckBoxBox()" in quotes, and there for it is not looking for a CheckBoxBox() object, it is looking for an object with the title "CheckBoxBox(1)".  

Secondly, 

<< Select

is not a message that CheckBoxBox() has available to it.  

TB1[CheckBoxBox(1)] <<  get selected ; 

would be what you want, except for the fact that << get selected returns the string values for each of the check boxes selected, and since all of your string values for your check boxes are set to " ", that will be all you will be returned. So what you will need to do is to loop through each of the check boxes, and find the values. Here is a simple example

For( c = 1, c <= 10, c++,
	For( r = 1, r <= 10, r++,
		If( T[CheckBoxBox( c )] << get( r ) == 1,
			Show( c, r )
		)
	)
)
Jim
pmroz
Super User

Re: How to index into a table box of check boxes

Here's a way to do what you need:

n = 10;		// # rows
m = 10;		// # cols
a = 1::n;

// Create a list of empty text fields as checkbox labels
cb_list = {};
for (i = 1, i <= n, i++,
	cb_list[i] = "";
);


cbmat = j(n, m, 0);
// Create the window
nw = new window("Test",
	tb = table box(
		ncb = number col box("", a),
	),
	okb = button box("OK",
		for (i = 1, i <= m, i++,
			for (k = 1, k <= n, k++,
				cbmat[k, i] = cb[i] << get(k);
			),
		);
		show(cbmat);
		nw << close window;
	),
);

// Create an array of checkbox columns
cb = {};
// Add the checkboxes
for (i = 1, i <= m, i++,
	cb[i] = checkbox(cb_list);
	cb[i] << set heading(char(i));
	tb << append(cb[i]);
);

checkbox_matrix.png

cbmat = 
[	1 0 0 0 0 0 0 0 0 0, 
	1 0 0 0 0 0 0 0 0 0, 
	1 0 1 0 0 0 0 0 0 0, 
	0 0 1 0 0 0 0 0 0 0, 
	0 0 1 0 1 0 0 0 0 0, 
	0 0 0 0 1 0 1 0 0 0, 
	0 0 0 0 0 0 1 0 0 0, 
	0 0 0 0 0 0 1 0 0 0, 
	0 0 0 0 0 0 0 0 0 0, 
	0 0 0 0 0 0 0 0 0 0];
uday_guntupalli
Level VIII

Re: How to index into a table box of check boxes

@pmroz  and @txnelson ,
        Thank you for your responses. However, if I may, I think the primary part of my question that is, how do I set them to selected(My bad - I should have asked checked) doesn't seem to have been addressed. Could either of you guide me as to how I can check any of the checkboxes ? 

         I think @pmroz  's response provides a way to index to the checkbox, but I think it references them by column, not so much by each individual check box. I will try and illustrate in a little more detail what I seek: 

         The snippet I posted gives me a matrix of selectable checkboxes like so: 

 

image.png

         Now, should a user make his selection, I am able to unload the selection using the following: 

 

 

NW = New Window("Test",
					VLB0 = V List Box(Align(center),
									  LB_b
									 )
			   ); 
VLB0 << Append(
				H List Box(
								BB_TargetMatrix = Button Box( "OK", 
																																															
																ResMat = {}; 
																// loop through each row
																For( i = 1, i <= nR, i++, 
																		ResMat[i] = {};
																		// loop through each column getting values
																		For( r = 1, r <= nC, r++,
																				ResMat[i][r] = TB1[CheckBoxBox( r )] << get( i )
																		   );	
																   );	
																ResMat = Matrix( ResMat );
																																								
															)// end of button box 
							 )// end of H List Box 
			  );

image.png

 

     

           However, I would like to know how I can the table box with some of the checkboxes pre-checked. I have a matrix the same size as the table box, which I would like to use to set the checkboxes checked. 

 

 

 

Best
Uday
pmroz
Super User

Re: How to index into a table box of check boxes

This code will set the checkboxes from a saved matrix of 1s and 0s.

// Set some random values in this matrix
saved_cbmat = 
[	1 0 0 1 0 0 0 0 0 0, 
	0 0 0 0 0 0 0 0 0 0, 
	0 1 0 0 0 0 0 0 0 0, 
	0 1 0 0 0 0 1 0 0 0, 
	0 1 0 1 0 0 1 0 1 0, 
	0 0 0 0 0 0 0 0 0 1, 
	0 0 0 0 0 0 0 0 1 1, 
	0 0 0 0 0 0 0 0 1 0, 
	0 0 0 0 0 0 0 0 1 0, 
	0 0 0 0 0 0 0 0 0 0];

n = 10;		// # rows
m = 10;		// # cols
a = 1::n;

// Create a list of empty text fields as checkbox labels
cb_list = {};
for (i = 1, i <= n, i++,
	cb_list[i] = "";
);


cbmat = j(n, m, 0);
// Create the window
nw = new window("Test",
	tb = table box(
		ncb = number col box("", a),
	),
	okb = button box("OK",
		for (i = 1, i <= m, i++,
			for (k = 1, k <= n, k++,
				cbmat[k, i] = cb[i] << get(k);
			),
		);
		show(cbmat);
		nw << close window;
	),
);

// Create an array of checkbox columns
cb = {};
// Add the checkboxes
for (i = 1, i <= m, i++,
	cb[i] = checkbox(cb_list);
	cb[i] << set heading(char(i));
	tb << append(cb[i]);
);

// Preload the checkboxes from the saved matrix
for (i = 1, i <= m, i++,
	for (k = 1, k <= n, k++,
		on_off = saved_cbmat[k, i];
		cb[i] << set(k, on_off);
	),
);

Recommended Articles