cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
%3CLINGO-SUB%20id%3D%22lingo-sub-800377%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EC%C3%B3digo%20de%20retraso%20hasta%20que%20se%20complete%20la%20aplicaci%C3%B3n%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-800377%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ETengo%20un%20script%20en%20el%20que%20primero%20hago%20una%20pregunta%20de%20s%C3%AD%2Fno%20en%20un%20cuadro%20de%20di%C3%A1logo.%20Si%20el%20usuario%20marca%20%22s%C3%AD%22%2C%20se%20ejecutar%C3%A1%20una%20secci%C3%B3n%20de%20c%C3%B3digo%20que%20extrae%20datos%20de%20una%20base%20de%20datos%20que%20luego%20se%20utilizan%20para%20crear%20una%20aplicaci%C3%B3n.%20En%20esa%20aplicaci%C3%B3n%2C%20el%20usuario%20interact%C3%BAa%20con%20los%20datos%20(tablas%20y%20gr%C3%A1ficos)%20para%20producir%20un%20formulario%20en%20PDF%2C%20finalizar%20esos%20materiales%2C%20cerrar%20la%20aplicaci%C3%B3n%20y%20luego%20pasar%20a%20la%20siguiente%20estaci%C3%B3n%2C%20momento%20en%20el%20que%20obtiene%20la%20misma%20pregunta%20de%20s%C3%AD%2Fno%2C%20pero%20para%20una%20ubicaci%C3%B3n%20diferente.%20El%20problema%20es%20que%20si%20selecciono%20s%C3%AD%2C%20el%20c%C3%B3digo%20se%20ejecuta%20y%20crea%20la%20aplicaci%C3%B3n%20(todo%20genial)%2C%20pero%20luego%20contin%C3%BAa%20con%20el%20siguiente%20cuadro%20de%20di%C3%A1logo.%20Una%20vez%20que%20aparece%20ese%20cuadro%20de%20di%C3%A1logo%2C%20no%20puedo%20interactuar%20con%20mi%20aplicaci%C3%B3n.%20%C2%BFC%C3%B3mo%20puedo%20codificar%20esto%20para%20que%20el%20siguiente%20di%C3%A1logo%20no%20aparezca%20hasta%20que%20haya%20terminado%20con%20mi%20aplicaci%C3%B3n%3F%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EEvento%3Ddi%C3%A1logo(%22%C2%BFHay%20muestras%20en%20el%20Sitio%20A%3F%22%2C%3CBR%20%2F%3E%20Vlist(Lineup(1%2Ceventtype%3Dbotones%20de%20radio(%22S%C3%AD%22%2C%22No%22)%2C)))%3B%3C%2FP%3E%3CP%3ESi(Evento%5B%22tipo%20de%20evento%22%5D%20%3D%3D%201%2C(%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%2F%2FSi%20el%20usuario%20selecciona%20S%C3%AD%2C%20entonces%20aqu%C3%AD%20se%20ejecuta%20el%20c%C3%B3digo%20de%20este%20sitio%20para%20generar%20una%20aplicaci%C3%B3n%20con%20gr%C3%A1ficos%20y%20tablas%20(ver%20el%20ejemplo%20a%20continuaci%C3%B3n).%20El%20usuario%20debe%20seleccionar%20puntos%20en%20el%20gr%C3%A1fico%2C%20generar%20un%20formulario%20PDF%20y%20luego%20cerrar%20la%20aplicaci%C3%B3n%20antes%20de%20continuar.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E)%3B%3CBR%20%2F%3E%20)%3B%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EEn%20esta%20captura%20de%20pantalla%20se%20puede%20ver%20un%20bot%C3%B3n%20que%20dice%20%22Finalizar%22.%20No%20quiero%20que%20aparezca%20el%20siguiente%20cuadro%20de%20di%C3%A1logo%20hasta%20que%20se%20haya%20hecho%20clic%20en%20%C3%A9l.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22RVhydrA_0-1726761392044.png%22%20style%3D%22width%3A%20631px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22RVhydrA_0-1726761392044.png%22%20style%3D%22width%3A%20631px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22RVhydrA_0-1726761392044.png%22%20style%3D%22width%3A%20631px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22RVhydrA_0-1726761392044.png%22%20style%3D%22width%3A%20631px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22RVhydrA_0-1726761392044.png%22%20style%3D%22width%3A%20631px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22RVhydrA_0-1726761392044.png%22%20style%3D%22width%3A%20631px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22RVhydrA_0-1726761392044.png%22%20style%3D%22width%3A%20631px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F68455i8F275EC0DC25F427%2Fimage-dimensions%2F631x451%3Fv%3Dv2%22%20width%3D%22631%22%20height%3D%22451%22%20role%3D%22button%22%20title%3D%22RVhydrA_0-1726761392044.png%22%20alt%3D%22RVhydrA_0-1726761392044.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EEjecutando%20JMP%2016.2.0%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-800377%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EAutomatizaci%C3%B3n%20y%20scripting%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExploraci%C3%B3n%20y%20visualizaci%C3%B3n%20de%20datos%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-800435%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20c%C3%B3digo%20de%20retraso%20hasta%20que%20se%20complete%20la%20aplicaci%C3%B3n%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-800435%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EPor%20ejemplo%2C%20puede%20agregar%20la%20expresi%C3%B3n%20para%20crear%20el%20siguiente%20cuadro%20de%20di%C3%A1logo%20dentro%20del%20bot%C3%B3n%20Finalizar.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-800848%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20c%C3%B3digo%20de%20retraso%20hasta%20que%20se%20complete%20la%20aplicaci%C3%B3n%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-800848%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EEsa%20es%20una%20buena%20idea%2C%20pero%20he%20estado%20jugando%20con%20el%20c%C3%B3digo%20y%20no%20puedo%20descubrir%20c%C3%B3mo%20hacer%20que%20funcione.%20Cuando%20coloco%20el%20cuadro%20de%20di%C3%A1logo%20dentro%20del%20bot%C3%B3n%20de%20finalizaci%C3%B3n%2C%20el%20c%C3%B3digo%20crea%20esa%20aplicaci%C3%B3n%20y%20luego%2C%20antes%20de%20que%20pueda%20interactuar%20con%20ella%2C%20avanza%20al%20siguiente%20ciclo%20para%20crear%20la%20de%20la%20siguiente%20ubicaci%C3%B3n.%20Necesito%20tener%20una%20forma%20de%20pausar%20el%20c%C3%B3digo%20cuando%20la%20aplicaci%C3%B3n%20termina%20de%20crearse%20y%20reiniciarla%20autom%C3%A1ticamente%20una%20vez%20que%20haya%20presionado%20el%20bot%C3%B3n%20de%20finalizaci%C3%B3n.%20No%20estoy%20seguro%20de%20si%20ser%C3%A1%20%C3%BAtil%2C%20pero%20adjunto%20algo%20de%20c%C3%B3digo.%20El%20primer%20di%C3%A1logo%20aparece%20en%20la%20l%C3%ADnea%205%2C%20luego%2C%20si%20selecciona%20s%C3%AD%2C%20extraer%C3%A1%20datos%20de%20nuestro%20servidor%20interno...%20esto%20no%20se%20ejecutar%C3%A1%20para%20nadie%20m%C3%A1s%20(l%C3%ADneas%2024%20a%20638)%2C%20luego%20la%20aplicaci%C3%B3n%20se%20crea%20a%20partir%20de%20la%20tabla%20de%20datos%20que%20cre%C3%B3%20el%20c%C3%B3digo%20anterior.%20(646%20a%201069)%2C%20luego%20el%20c%C3%B3digo%20se%20repite%20pero%20para%20un%20conjunto%20diferente%20de%20datos%20(l%C3%ADnea%201080).%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-800854%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20c%C3%B3digo%20de%20retraso%20hasta%20que%20se%20complete%20la%20aplicaci%C3%B3n%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-800854%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ENo%20estoy%20tan%20familiarizado%20con%20las%20aplicaciones%2Fpaneles%20de%20control%20JMP%20(siempre%20los%20construyo%20yo%20mismo%20para%20tener%20control%20total)%2C%20pero%20desear%C3%ADa%20que%20la%20secci%C3%B3n%20despu%C3%A9s%20de%201080%20no%20se%20ejecute%20hasta%20que%20el%20usuario%20presione%20%22Finalizar%22.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-800896%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20c%C3%B3digo%20de%20retraso%20hasta%20que%20se%20complete%20la%20aplicaci%C3%B3n%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-800896%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ESe%20me%20ocurri%C3%B3%20una%20%22soluci%C3%B3n%22%3A%20simplemente%20puse%20un%20comando%20de%20espera%20antes%20de%20la%20l%C3%ADnea%201080%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EIf(%20Event%5B%22eventtype%22%5D%20%3D%3D%201%2C%0A%0A%20%20%20%20%20wait(30)%3B%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EEntonces%2C%20si%20seleccion%C3%A9%20%22S%C3%AD%22%20antes%2C%20sabe%20que%20gener%C3%A9%20una%20aplicaci%C3%B3n%20y%20necesito%20tiempo%20para%20interactuar%20con%20ella.%20Esto%20le%20da%20al%20usuario%2030%20segundos%20para%20completar%20esa%20acci%C3%B3n%2C%20%22terminar%22%20y%20luego%20pasar%C3%A1%20al%20siguiente%20componente%20del%20script...%20es%20una%20soluci%C3%B3n%20funcional%2C%20aunque%20no%20es%20lo%20que%20hubiera%20preferido.%20Sin%20duda%2C%20pone%20al%20usuario%20%22contra%20reloj%22.%20Tendr%C3%A9%20que%20jugar%20con%20el%20tiempo%20de%20espera%20para%20encontrar%20un%20punto%20intermedio.%20Gracias%20por%20tu%20ayuda...%20me%20hizo%20pensar.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-800986%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20c%C3%B3digo%20de%20retraso%20hasta%20que%20se%20complete%20la%20aplicaci%C3%B3n%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-800986%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ETe%20envi%C3%A9%20un%20mensaje%20en%20el%20que%20muestro%20lo%20que%20podr%C3%ADa%20haber%20hecho.%20B%C3%A1sicamente%2C%20mover%C3%ADa%20la%20segunda%20parte%20del%20script%20a%20expresi%C3%B3n%20(har%C3%ADa%20otras%20separaciones%20para%20mejorar%20la%20legibilidad%2C%20pero%20esa%20deber%C3%ADa%20ser%20la%20%C3%BAnica%20%22necesaria%22)%20y%20luego%20la%20agregar%C3%ADa%20a%20la%20funci%C3%B3n%2Fscript%20del%20bot%C3%B3n5.%20Esto%20har%C3%ADa%20que%20la%20expresi%C3%B3n%20se%20active%20cuando%20se%20presione%20el%20bot%C3%B3n5.%20Esa%20opci%C3%B3n%20podr%C3%ADa%20requerir%20algo%20de%20trabajo%20adicional%20seg%C3%BAn%20c%C3%B3mo%20se%20gestionen%20los%20%C3%A1mbitos%20y%20los%20espacios%20de%20nombres.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
RVhydrA
Level III

delay code until application is completed

I have a script in which I am first asking a yes/no question in a dialogue box, if the use marks "yes", then a section of code will run that pulls data from a database which is then used to build an application. In that app the user interacts with the data (table and plots) to produce a pdf form, finalize those materials, close the application, and then move on to the next station at which time you get the same yes/no question but for a different location. The problem is that if I select yes, the code runs and creates the application (all great), but then continues on to the next dialogue box. Once that dialogue box pops up I cannot interact with my application. How can I code this so that the next dialogue doesn't come up until I am finished with my application?

 

Event=dialog("Are there samples at Site A?",
Vlist(Lineup(1,eventtype=radio buttons("Yes","No"),)));

If(Event["eventtype"] == 1,(

 

 //if the user selects yes then within here the code for this site runs to produce an application with graphs and tables (see example below). User must select points in the graph, generate pdf form, and then close the application before moving on.

 

);
);

 

 

In this screenshot you can see a button that says "finish up." I don't want my next dialogue box to pop up until after this has been clicked. 

RVhydrA_0-1726761392044.png

 

Running JMP 16.2.0

5 REPLIES 5
jthi
Super User

Re: delay code until application is completed

You can for example add the expression to create the next dialogue box inside the finish up button

-Jarmo
RVhydrA
Level III

Re: delay code until application is completed

Thats a good idea, but I've been messing around with the code and can't figure out how to get that to work. When I put the dialogue box inside the finish up button the code builds that application and then before I can interact with it, advances on to the next cycle to build the one for the next location. I need to have a way to pause the code when the application is done building, and automatically kick start it back up once I've hit the finish up button. I'm not sure if it'll be helpful, but I'm attaching some code. The first dialogue comes in at line 5, then if you select yes, it'll pull data from our internal server.. this won't run for anyone else (lines 24 - 638), then the application is built off the data table the previous code built.  (646 - 1069), then the code repeats but for a different set of data (line 1080).

 

jthi
Super User

Re: delay code until application is completed

I'm not that familiar with JMP Applications/Dashboards (I always build them myself to have full control) but you would want that the section after 1080 isn't executed until user presses "Finish Up"

-Jarmo
RVhydrA
Level III

Re: delay code until application is completed

I came up with a "solution." I simply put a wait command before line 1080 

If( Event["eventtype"] == 1,

     wait(30);
);

so if "Yes" was selected earlier, it knows that I generated an application and need to have time to interact with it. This gives the user 30 seconds to complete that action, "finish up" and then it'll move on to the next component of the script... its a functional solution though not what I'd have preferred. Certainly puts the user "on the clock" I'll have to mess around with the wait time to find a happy medium. Thanks for your help.. it got me thinking. 

jthi
Super User

Re: delay code until application is completed

I sent you a message in which I show what I might have done. I basically would move the second part of the script into expression (I would make other separations to improve readability but that should be the only "necessary" one) and then add that to the button5 function/script. This would make the expression trigger when the button5 is pressed. That option might require some additional work depending on how the scopes and namespaces are being handled.

-Jarmo