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-46546%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EScriptable%5B%5D%20ou%20'envoyer%20attend%20un%20objet%20scriptable'%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-46546%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ESalut%2C%3C%2FP%3E%0A%3CP%3EJ'ai%20essay%C3%A9%20de%20nombreuses%20m%C3%A9thodes%20pour%20essayer%20de%20s%C3%A9lectionner%20des%20lignes%20sp%C3%A9cifiques%20avec%20PM%23%3D2%20et%20Logistic%23%3D1%20dans%20ma%20table%20pr%C3%A9-filtr%C3%A9e%2C%20mais%20je%20re%C3%A7ois%20soit%20un%20message%20%C2%AB%20Envoyer%20attend%20un%20objet%20scriptable%20%C2%BB%2C%20soit%20un%20%C2%AB%20Scriptable%5B%5D%20%C2%BB%2C%20puis%20fin%20du%20script%20ou%20boucle%20sans%20fin.Quelqu'un%20peut-il%20m'aider%20sur%20ce%20qui%20est%20inappropri%C3%A9%20avec%20la%20syntaxe%20et%20que%20je%20ne%20peux%20pas%20programmer%20la%20s%C3%A9lection%20de%20lignes%26nbsp%3B%3FMerci!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Elamstationfile%3DPick%20File(%22choose%20file%22%2C%22%24Documents%22%20)%3B%0Adt%3DOpen(lamstationfile%2C%0AImport%20Settings(End%20Of%20Field(%20Tab%20)%2CScan%20Whole%20File(%201%20)%2C%20Column%20Names%20Start(7%20)%2CData%20Starts(%208)%2C))%3B%0Adt%20%3D%20Current%20Data%20Table()%3B%0A%0A%2F%2Ffind%20data%20rows%0Aw%3DNRow(dt)%3B%0Adt%26lt%3B%3CSELECT%20where%3D%22%22%3E(d-1))%3B%0Adt2%3Ddt%26lt%3B%3CSUBSET%3E(d-1))%26lt%3B%3CDELETE%20rows%3D%22%22%3E%3C%2FDELETE%3E%3C%2FSUBSET%3E%3C%2FSELECT%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-46639%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20Scriptable%5B%5D%20ou%20'envoyer%20attend%20un%20objet%20scriptable'%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-46639%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ELes%20donn%C3%A9es%20que%20vous%20avez%20jointes%20sont%20un%20fichier%20que%20je%20ne%20parviens%20pas%20%C3%A0%20ouvrir.%3CBR%20%2F%3E%20Pouvez-vous%20simplement%20fournir%20un%20petit%20sous-ensemble%20du%20tableau%20avec%20lequel%20vous%20essayez%20de%20travailler%20%3F%3CBR%20%2F%3E%20Une%20raison%20pour%20laquelle%20je%20peux%20penser%20%C3%A0%20la%20raison%20pour%20laquelle%20votre%20s%C3%A9lection%20de%20lignes%20ne%20fonctionne%20pas.%3CBR%20%2F%3E%3CBR%20%2F%3E%20En%20plus%20de%20fournir%20un%20exemple%20d'ensemble%20de%20donn%C3%A9es%2C%20pouvez-vous%20essayer%20ceci%26nbsp%3B%3F%3CBR%20%2F%3E%20dt%20%3D%20Table%20de%20donn%C3%A9es%20actuelle%20()%3B%3CBR%20%2F%3E%20Et%20puis%20ex%C3%A9cutez%20votre%20s%C3%A9lection%20o%C3%B9%20dt%20est%20la%20table%20de%20donn%C3%A9es%20avec%20laquelle%20vous%20travaillez.%3CBR%20%2F%3E%20Si%20JMP%20ne%20reconna%C3%AEt%20pas%20ou%20a%20perdu%20la%20r%C3%A9f%C3%A9rence%20de%20la%20table%20de%20donn%C3%A9es%2C%20quelle%20que%20soit%20votre%20approche%2C%20l'op%C3%A9ration%20de%20s%C3%A9lection%20de%20ligne%20ne%20fonctionnera%20pas.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-46637%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20Scriptable%5B%5D%20ou%20'envoyer%20attend%20un%20objet%20scriptable'%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-46637%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EMerci%20pour%20votre%20r%C3%A9ponse.%20Je%20pense%20que%20cette%20faute%20de%20frappe%20ne%20s'est%20produite%20que%20lorsque%20je%20transf%C3%A9rais%20le%20code%20vers%20la%20discussion%20en%20ligne.%20Il%20n'y%20a%20pas%20eu%20de%20faute%20de%20frappe%20sur%20mon%20ordinateur%2C%20sinon%20j'aurais%20eu%20une%20erreur%20diff%C3%A9rente.%20De%20plus%2C%20les%20m%C3%A9thodes%20n%C2%B01%2C%20n%C2%B03%20et%20n%C2%B04%20n%E2%80%99ont%20pas%20non%20plus%20fonctionn%C3%A9%20pour%20moi.%20Pas%20certain%20de%20pourquoi.%3CBLOCKQUOTE%3E%3CHR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F6696%22%20target%3D%22_blank%22%3E%40uday_guntupalli%3C%2FA%3E%20a%20%C3%A9crit%3A%3CBR%20%2F%3E%20dt3%20%26lt%3B%3CS%C3%89LECTIONNER%20o%C3%B9%3D%22%22%3E%3C%2FS%C3%89LECTIONNER%3E%3CLINGO-SUB%20id%3D%22lingo-sub-46610%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20Scriptable%5B%5D%20ou%20'envoyer%20attend%20un%20objet%20scriptable'%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-46610%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EJe%20pensais%20que%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F6696%22%20target%3D%22_blank%22%3E%20%40uday_guntupalli%3C%2FA%3E%20le%20code%20devrait%20fonctionner%2C%20mais%20dans%2013.2.1%2C%20ce%20ne%20serait%20pas%20le%20cas%20(%C3%A9trange).Cependant%2C%20utiliser%20As%20Column()%20au%20lieu%20de%20Column()%20a%20permis%20%C3%A0%20votre%20code%20sp%C3%A9cifique%20de%20fonctionner%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0Adt3%20%3D%20Open(%20%22%24SAMPLE_DATA%2FBig%20Class.jmp%22%20)%3B%0Alogis%20%3D%20%2255%22%3B%0Aclos%20%3D%20%22Height%22%3B%0Adt3%20%26lt%3B%26lt%3B%20Select%20Where(%20As%20Column(%20dt3%2C%20clos%20)%20%3D%3D%20Num(%20logis%20)%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-46609%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20Scriptable%5B%5D%20ou%20'envoyer%20attend%20un%20objet%20scriptable'%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-46609%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3Edt3%20%26lt%3B%3CS%C3%89LECTIONNER%20o%C3%B9%3D%22%22%3E%3CLINGO-SUB%20id%3D%22lingo-sub-46608%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20Scriptable%5B%5D%20ou%20'envoyer%20attend%20un%20objet%20scriptable'%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-46608%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ED%C3%A9sol%C3%A9%2C%20j'aurais%20d%C3%BB%20%C3%AAtre%20plus%20clair.Le%20probl%C3%A8me%20que%20je%20rencontre%20concerne%20la%20fin%20de%20mon%20code%20apr%C3%A8s%20avoir%20cr%C3%A9%C3%A9%20une%20troisi%C3%A8me%20table%20de%20donn%C3%A9es%20dt3.%20Tout%20avant%20la%20derni%C3%A8re%20ligne%20de%20code%20active%20fonctionne%20correctement%20%5Bobtenir%20des%20lignes%20et%20des%20colonnes%20dans%20la%20premi%C3%A8re%20table%20de%20donn%C3%A9es%20dt%2C%20d%C3%A9finir%20les%20entr%C3%A9es%20PM%23%3D2%20et%20Logistic%23%3D1%20sont%20tr%C3%A8s%20bien%5D.Je%20ne%20peux%20tout%20simplement%20pas%20s%C3%A9lectionner%20plusieurs%20lignes%20dans%20dt3%20o%C3%B9%20Logistic%23%20%3D1%20.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJ'ai%20essay%C3%A9%20plusieurs%20m%C3%A9thodes%20diff%C3%A9rentes%2C%20comme%20indiqu%C3%A9%20dans%20l'extrait%20de%20code%20ci-dessous%2C%20mais%20le%20code%20se%20termine%20par%20la%20note%20%C2%AB%20Scriptable%5B%5D%20%C2%BB%20ou%20l'erreur%20%C2%AB%20Envoyer%20attend%20un%20objet%20scriptable%20%C2%BB.Je%20ne%20sais%20pas%20o%C3%B9%20dans%20le%20code%20ci-dessous%20l'emp%C3%AAche%20de%20fonctionner%20correctement.%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22%20language-jsl%22%3E%3CCODE%20class%3D%22%20%20language-jsl%22%3E%3CSPAN%20class%3D%22token%20comment%22%3E%2F%2Fdt3%26lt%3B%3CGET%20rows%3D%22%22%20where%3D%22%22%3E%0A%20%0Adt3%3CSPAN%20class%3D%22token%20operator%22%3E%26lt%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22token%20operator%22%3E%26lt%3B%3C%2FSPAN%3ESelet%20Where%3CSPAN%20class%3D%22token%20punctuation%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22token%20punctuation%22%3E%3A%3C%2FSPAN%3E%3CSPAN%20class%3D%22token%20function%22%3EColumn%3C%2FSPAN%3E%3CSPAN%20class%3D%22token%20punctuation%22%3E(%3C%2FSPAN%3E%20dt3%3CSPAN%20class%3D%22token%20punctuation%22%3E%2C%3C%2FSPAN%3E%20clos%20%3CSPAN%20class%3D%22token%20punctuation%22%3E)%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22token%20operator%22%3E%3D%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22token%20function%22%3ENum%3C%2FSPAN%3E%3CSPAN%20class%3D%22token%20punctuation%22%3E(%3C%2FSPAN%3E%20logis%20%3CSPAN%20class%3D%22token%20punctuation%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22token%20punctuation%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22token%20punctuation%22%3E%3B%3C%2FSPAN%3E%20%20%20%3CSPAN%20class%3D%22token%20comment%22%3E%2F%2FMethod%232%3C%2FSPAN%3E%0A%20%0A%3CSPAN%20class%3D%22token%20comment%22%3E%2F%2FFor(i%3D1%2C%20i%3DNRows(dt3)%2C%20i%2B%2B%2C%20%20%20%20%2F%2FMethod%233%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22token%20comment%22%3E%2F%2FIf(%20Column(%20dt3%2C%20clos%20)%5Bi%5D%20%3D%3D%20Num(%20logis%20)%2C%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22token%20comment%22%3E%2F%2F%20Column(%20dt3%2C%20clos%20)%5Bi%5D%20%26lt%3B%26lt%3B%20Set%20Selected(%201%20))%3B%20%20)%3B%3C%2FSPAN%3E%0A%20%0A%20%0A%3CSPAN%20class%3D%22token%20comment%22%3E%2F%2FFor%20Each%20Row(If(%20%3AColumn(%20dt3%2C%20clos%20)%20%3D%3D%20Num(%20logis%20)%2C%20%3AColumn(%20dt3%2C%20clos%20)%20%26lt%3B%26lt%3B%20Set%20%2F%2FSelected(1))%3B%20%20%2F%2FMethod%234%3C%2FSPAN%3E%3C%2FGET%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-46558%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20Scriptable%5B%5D%20ou%20'envoyer%20attend%20un%20objet%20scriptable'%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-46558%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EVoici%20un%20script%20qui%20couvre%20le%20premier%20probl%C3%A8me%20de%20votre%20table%20de%20donn%C3%A9es%2C%20en%20s%C3%A9lectionnant%20la%20ligne%20apr%C3%A8s%20avoir%20trouv%C3%A9%20%22NUM_DATA_ROWS%26nbsp%3B%3A%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Elamstationfile%20%3D%20Pick%20File(%20%22choose%20file%22%2C%20%22%24Documents%22%20)%3B%0Adt%20%3D%20Open(%20lamstationfile%2C%20Import%20Settings(%20End%20Of%20Field(%20Tab%20)%2C%20%0AScan%20Whole%20File(%201%20)%2C%20Column%20Names%20Start(%207%20)%2C%20Data%20Starts(%208%20)%2C%20)%20)%3B%0Adt%20%3D%20Current%20Data%20Table()%3B%0A%0A%2F%2Ffind%20data%20rows%0Aw%20%3D%20N%20Row(%20dt%20)%3B%0Adt%20%26lt%3B%26lt%3B%20Select%20Where(%20%3ATime%20%3D%3D%20%22NUM_DATA_ROWS%22%20)%20%26lt%3B%26lt%3B%20Label(%201%20)%3B%0Ad%20%3D%20dt%20%26lt%3B%26lt%3B%20Get%20Selected%20Rows%3B%0AShow(%20d%20)%3B%0A%2F%2F%20A%20matrix%20is%20returned%20from%20%26lt%3B%26lt%3B%20Get%20Selected%20Rows%2C%20so%20you%20need%20to%20reference%20d%5B1%5D%0Adt%20%26lt%3B%26lt%3B%20Select%20Where(%20Row()%20%26gt%3B%20(d%5B1%5D%20-%201)%20)%3B%0Adt2%20%3D%20dt%20%26lt%3B%26lt%3B%20Subset(%20Selected%20Rows(%201%20)%2C%20Selected%20columns%20only(%200%20)%20)%3B%0Adt%20%2F*%26lt%3B%26lt%3B%20Select%20Where(%20Row()%20%26gt%3B%20(d%20-%201)%20)*%2F%20%26lt%3B%26lt%3B%20Delete%20Rows%3B%0A%2F%2F%20Change%20first%20two%20columns%20to%20numeric%20data%0AColumn(%20dt%2C%201%20)%20%26lt%3B%26lt%3B%20Data%20Type(%20Numeric%20)%3B%0AColumn(%20dt%2C%201%20)%20%26lt%3B%26lt%3B%20Modeling%20Type(%20%22Continuous%22%20)%3B%0AColumn(%20dt%2C%201%20)%20%26lt%3B%26lt%3B%20format(%22hr%3Am%3As%22)%3B%0AColumn(%20dt%2C%202%20)%20%26lt%3B%26lt%3B%20Data%20Type(%20Numeric%20)%3B%0AColumn(%20dt%2C%202%20)%20%26lt%3B%26lt%3B%20Modeling%20Type(%20%22Continuous%22%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EConcernant%20votre%20s%C3%A9lection%20de%20colonnes%20puis%20votre%20sous-ensemble%2C%20je%20vous%20sugg%C3%A8re%20d'utiliser%20l'outil%20de%20s%C3%A9lection%20de%20colonnes%20int%C3%A9gr%C3%A9%2C%20%22Columns%20Viewer%22%2C%20plut%C3%B4t%20que%20de%20cr%C3%A9er%20votre%20propre%20outil%20de%20s%C3%A9lection.%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edt%20%26lt%3B%26lt%3B%20Columns%20Viewer%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-46552%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20Scriptable%5B%5D%20ou%20'envoyer%20attend%20un%20objet%20scriptable'%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-46552%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ED%C3%A9sol%C3%A9.Les%20donn%C3%A9es%20sont%20d%C3%A9sormais%20correctement%20jointes.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-46547%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20Scriptable%5B%5D%20ou%20'envoyer%20attend%20un%20objet%20scriptable'%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-46547%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%2F10002%22%20target%3D%22_blank%22%3E%40asdf%3C%2FA%3E%20%3A%3CBR%20%2F%3E%20Le%20fichier%20de%20pi%C3%A8ce%20jointe%20(.zip)%20est%20vide.%20Vos%20donn%C3%A9es%20n'ont%20donc%20pas%20%C3%A9t%C3%A9%20fournies%20pour%20tester%20votre%20code%20et%20voir%20votre%20erreur%20pour%20d%C3%A9panner.%3CBR%20%2F%3EEn%20l'absence%20des%20donn%C3%A9es%20r%C3%A9elles%20avec%20lesquelles%20vous%20travaillez%2C%20regardons%20ici%20cet%20exemple.%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edt%20%3D%20Open(%20%22%24SAMPLE_DATA%2FAir%20Traffic.jmp%22%20)%3B%0A%0Adt%20%26lt%3B%26lt%3B%20Select%20Where(%3AAirline%20%3D%3D%20%22Delta%22%20%26amp%3B%20%3AEvent%20%3D%3D%20%22Arrive%22)%3B%20%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EComme%20vous%20pouvez%20le%20voir%2C%20vous%20pouvez%20s%C3%A9lectionner%20des%20lignes%20dans%20lesquelles%20deux%20conditions%20diff%C3%A9rentes%20sur%20deux%20colonnes%20diff%C3%A9rentes%20sont%20remplies.%3CBR%20%2F%3E%3CBR%20%2F%3EDans%20votre%20cas%20-%20si%20le%3CSPAN%3E%20PM%23%3D2%20et%20Logistic%23%3D1%20font%20r%C3%A9f%C3%A9rence%20%C3%A0%202%20tables%20diff%C3%A9rentes%20-%20vous%20devez%20alors%20joindre%20les%20tables%20en%20fonction%20de%20colonnes%20communes%20pour%20ce%20que%20vous%20recherchez.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ESi%20ce%20n'est%20pas%20le%20cas%2C%20veuillez%20fournir%20des%20exemples%20de%20donn%C3%A9es%20r%C3%A9elles.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3C%2FS%C3%89LECTIONNER%3E%3C%2FLINGO-BODY%3E%3C%2FBLOCKQUOTE%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
asdf
Level I

Scriptable[] or 'send expects scriptable object'

Hi,

I've tried many methods of trying to select specific rows with PM#=2 and  Logistic#=1 in my pre-filtered table, but I either get a 'Send expects scriptable object' message, a 'Scriptable[]' and then script termination, or an endless loop.  Can someone please help with what is inappropriate with the syntax that I cannot program the row selection?  Thanks!

 

 

lamstationfile=Pick File("choose file","$Documents" );
dt=Open(lamstationfile,
Import Settings(End Of Field( Tab ),Scan Whole File( 1 ), Column Names Start(7 ),Data Starts( 8),));
dt = Current Data Table();

//find data rows
w=NRow(dt);
dt<<Select Where(:Time=="NUM_DATA_ROWS")<<Label(1);
d=dt<<Get Selected Rows;
Show(d);
dt<<Select Where(Row()>(d-1));
dt2=dt<<Subset( Selected Rows(1), Selected columns only(0));
dt<<Select Where(Row()>(d-1))<<Delete Rows;
// Change first two columns to numeric data
Column(dt,1)<< Data Type (Numeric); Column(dt,1)<<Modeling Type("Continuous");
Column(dt,2)<< Data Type (Numeric); Column(dt,2)<<Modeling Type("Continuous");
 

nw= New Window( "What PM?",<<Modal,<<Bring Window To Front,
V List Box( Text Box( "PM#"), pm_in = Text Edit Box("PM#", <<Justify Text (Center)), Spacer Box(Size(25,25))),
H List Box( Button Box("OK", pm= pm_in << Get Text();), Button Box("Cancel", nw<<Close Window)));
nw= New Window( "What Logistic?",<<Modal,<<Bring Window To Front,
V List Box( Text Box( "Logistic#"), wafer_in =Text Edit Box("Logistic#"), Spacer Box(Size(25,25))),
H List Box( Button Box("OK", logis= wafer_in << Get Text();), Button Box("Cancel", nw<<Close Window)));
//take out uneccessary PM data
Show("PM"|| pm);
ColNames = dt << Get Column Names();
colstrings = char(colnames);
match = regex(colstrings, "PM"|| pm);
//Show(colstrings);
found_list={};
close(dt2,no save);
//how can I have it with 2 dt open?
for (i = 1, i <= nitems(ColNames), i++,
if (contains(ColNames[i], match),
ColNames[i]<<Set Selected(1)
//insertinto(found_list, ColNames[i]);
);
);
Column(dt,1)<<Set Selected(1);
//For found_list<<Set Selected(1);
//Show(found_list);
dt3=dt<<Subset( Selected Rows(0), Selected columns only(1));

Num(logis);
Show(logis);
//Logistics column is the last in the table
clos=NCol(dt3);
Show(clos);
Show( Column( dt3, clos )[2] );
 
//dt3<<Get Rows Where(:Column(clos)==logis);  //Method #1
 
dt3<<Selet Where(:Column( dt3, clos ) == Num( logis ));   //Method#2
 
//For(i=1, i=NRows(dt3), i++,    //Method#3
//If( Column( dt3, clos )[i] == Num( logis ),
// Column( dt3, clos )[i] << Set Selected( 1 ));  );
 
 
//For Each Row(If( :Column( dt3, clos ) == Num( logis ), :Column( dt3, clos ) << Set //Selected(1));  //Method#4

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Scriptable[] or 'send expects scriptable object'

I thought that @uday_guntupalli code should work, however in 13.2.1 it would not(strange).  However, using As Column() instead of Column() allowed your specific code to work

Names Default To Here( 1 );
dt3 = Open( "$SAMPLE_DATA/Big Class.jmp" );
logis = "55";
clos = "Height";
dt3 << Select Where( As Column( dt3, clos ) == Num( logis ) );
Jim

View solution in original post

8 REPLIES 8
uday_guntupalli
Level VIII

Re: Scriptable[] or 'send expects scriptable object'

@asdf : 
    Attachment (.zip) file is empty - so your data was not provided to test your code and see you error to troubleshoot . 
   In the absence of the actual data you are working with - here lets look at this example . 

dt = Open( "$SAMPLE_DATA/Air Traffic.jmp" );

dt << Select Where(:Airline == "Delta" & :Event == "Arrive"); 

  As you can see - you can select rows where two different conditions on two different columns are being met. 

  In your case - if the PM#=2 and  Logistic#=1 refer to 2 different tables - then you need to join the tables based on common columns for what you are after. 

  If its not either - please provide actual sample data .

Best
Uday
asdf
Level I

Re: Scriptable[] or 'send expects scriptable object'

Sorry.  The data is now appropriately attached.

txnelson
Super User

Re: Scriptable[] or 'send expects scriptable object'

Here is a script that covers the first issue in your data table, selecting row after finding "NUM_DATA_ROWS:

lamstationfile = Pick File( "choose file", "$Documents" );
dt = Open( lamstationfile, Import Settings( End Of Field( Tab ), 
Scan Whole File( 1 ), Column Names Start( 7 ), Data Starts( 8 ), ) );
dt = Current Data Table();

//find data rows
w = N Row( dt );
dt << Select Where( :Time == "NUM_DATA_ROWS" ) << Label( 1 );
d = dt << Get Selected Rows;
Show( d );
// A matrix is returned from << Get Selected Rows, so you need to reference d[1]
dt << Select Where( Row() > (d[1] - 1) );
dt2 = dt << Subset( Selected Rows( 1 ), Selected columns only( 0 ) );
dt /*<< Select Where( Row() > (d - 1) )*/ << Delete Rows;
// Change first two columns to numeric data
Column( dt, 1 ) << Data Type( Numeric );
Column( dt, 1 ) << Modeling Type( "Continuous" );
Column( dt, 1 ) << format("hr:m:s");
Column( dt, 2 ) << Data Type( Numeric );
Column( dt, 2 ) << Modeling Type( "Continuous" );

Concerning your selection of columns and then subsetting, I would suggest that you use the builtin column selection tool, "Columns Viewer" rather than building your own selection tool.

dt << Columns Viewer;
Jim
asdf
Level I

Re: Scriptable[] or 'send expects scriptable object'

Sorry, I should have been more clear.  The problem I am having is with the end of my code after I've created a third data table dt3.  Everything before the last active line of code works fine [getting rows and columns in first data table dt, setting the inputs PM#=2 and Logistic#=1 are fine ].  I just cannot select several rows in dt3 where Logistic# =1 . 

 

I've tried several different methods as noted in the code excerpt below, but I either get code terminated with 'Scriptable[]' note or 'Send expects scriptable object' error.  I'm not sure where in the below code is preventing it from running appropriately.

  

 

 

//dt3<<Get Rows Where(:Column(clos)==logis);  //Method #1
 
dt3<<Selet Where(:Column( dt3, clos ) == Num( logis ));   //Method#2
 
//For(i=1, i=NRows(dt3), i++,    //Method#3
//If( Column( dt3, clos )[i] == Num( logis ),
// Column( dt3, clos )[i] << Set Selected( 1 ));  );
 
 
//For Each Row(If( :Column( dt3, clos ) == Num( logis ), :Column( dt3, clos ) << Set //Selected(1));  //Method#4

 

uday_guntupalli
Level VIII

Re: Scriptable[] or 'send expects scriptable object'

dt3 <<Select Where(:Column( dt3, clos ) == Num( logis )); // There is a typo to start with
Best
Uday
txnelson
Super User

Re: Scriptable[] or 'send expects scriptable object'

I thought that @uday_guntupalli code should work, however in 13.2.1 it would not(strange).  However, using As Column() instead of Column() allowed your specific code to work

Names Default To Here( 1 );
dt3 = Open( "$SAMPLE_DATA/Big Class.jmp" );
logis = "55";
clos = "Height";
dt3 << Select Where( As Column( dt3, clos ) == Num( logis ) );
Jim
asdf
Level I

Re: Scriptable[] or 'send expects scriptable object'

Thank you for your response. I think that typo only happened when I was transferring the code to the Online Discussion. There wasn't a typo on my computer, otherwise I would have gotten a different error. Also, Method#1, #3, and #4 didn't work for me either. Not sure why.

@uday_guntupalli wrote:
dt3 <<Select Where(:Column( dt3, clos ) == Num( logis ));
uday_guntupalli
Level VIII

Re: Scriptable[] or 'send expects scriptable object'

The data that you attached is a file , I am unable to open .
Can you just provide a small subset of the table you are trying to work with ?
One reason I can think of as to why your row selection doesn't work .

Besides providing sample data set , can you try this ?
dt = Current Data Table();
And then run your selection where dt is the data table you are working with .
If JMP doesn't recognize or has lost the reference of the data table , then irrespective of your approach - the row selection operation will not work .
Best
Uday

Recommended Articles