cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-428128%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EC%C3%B3mo%20activar%20un%20cuadro%20de%20bot%C3%B3n%20con%20%22script%20deseado%22%20desde%20el%20cuadro%20de%20texto.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-428128%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EComo%20se%20muestra%20a%20continuaci%C3%B3n%2C%20cuando%20el%20usuario%20ingresa%20el%20script%20deseado%20en%20el%20cuadro%20de%20texto%20(%3CSTRONG%3E%20ex.%20Distribuci%C3%B3n(%20Distribuci%C3%B3n%20Continua(%20Columna(%20%3AX)%20)%20)%3B%3C%2FSTRONG%3E%20)%3C%2FP%3E%3CP%3Ey%20luego%20ejecuta%20el%20cuadro%20de%20bot%C3%B3n%2C%20%C2%BFc%C3%B3mo%20se%20puede%20ejecutar%20el%20script%20correspondiente%20como%20an%C3%A1lisis%3F%20%C2%A1Gracias%20por%20dejarnos%20saber!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EQuiero%20que%20la%20secuencia%20de%20comandos%20se%20ejecute%20como%20an%C3%A1lisis%20cuando%20el%20usuario%20ingrese%20la%20secuencia%20de%20comandos%20deseada%20en%20el%20cuadro%20de%20texto%20y%20luego%20ejecute%20el%20cuadro%20de%20bot%C3%B3n%20como%20se%20muestra%20a%20continuaci%C3%B3n.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%C2%BFC%C3%B3mo%20puedo%20ejecutar%20el%20texto%20ingresado%20en%20el%20cuadro%20de%20texto%20inmediatamente%20con%20un%20clic%20de%20bot%C3%B3n%3F%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22CT_MG_0-1634630731843.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22CT_MG_0-1634630731843.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22CT_MG_0-1634630731843.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F36821i7A9C6764ACB4CFBF%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22CT_MG_0-1634630731843.png%22%20alt%3D%22CT_MG_0-1634630731843.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%3EAunque%20almacen%C3%A9%20el%20script%20deseado%20como%20una%20variable%20usando%20get%20text()%20y%20write()%2C%20no%20se%20ejecuta%20como%20un%20an%C3%A1lisis.%3CBR%20%2F%3E%20Te%20agradecer%C3%ADa%20mucho%20que%20me%20dijeras%20como%20solucionarlo.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-428128%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3EAnal%C3%ADtica%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ETabla%20de%20datos%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOtro%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Esecuencias%20de%20comandos%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eventanas%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-428425%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20C%C3%B3mo%20activar%20un%20cuadro%20de%20bot%C3%B3n%20con%20%22script%20deseado%22%20desde%20el%20cuadro%20de%20texto.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-428425%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%C2%A1Funciona!%3C%2FP%3E%3CP%3EGracias%20a%20todos%20por%20su%20amable%20ayuda%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Acara_con_una_leve_sonrisa%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-428174%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20C%C3%B3mo%20activar%20un%20cuadro%20de%20bot%C3%B3n%20con%20%22script%20deseado%22%20desde%20el%20cuadro%20de%20texto.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-428174%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EDebe%20mirar%20la%20funci%C3%B3n%20'Parse%20()'%3A%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0Atxt%20%3D%20%22x%2By%22%3B%0Ascr%20%3D%20Parse(txt)%3B%0A%0Ax%20%3D%202%3B%20y%20%3D%203%3B%0APrint(scr)%3B%0APrint(Eval(scr))%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EParece%20que%20escribir%20un%20script%20de%20esta%20manera%20ser%C3%ADa%20bastante%20propenso%20a%20errores.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-428173%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20C%C3%B3mo%20activar%20un%20cuadro%20de%20bot%C3%B3n%20con%20%22script%20deseado%22%20desde%20el%20cuadro%20de%20texto.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-428173%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EUtilice%20la%20combinaci%C3%B3n%20de%20funciones%20Eval(Parse())%20para%20ejecutar%20una%20cadena%20de%20texto%20de%20JSL%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22txnelson_0-1634639254977.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22txnelson_0-1634639254977.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22txnelson_0-1634639254977.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F36822iD57B684EC87B840E%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22txnelson_0-1634639254977.png%22%20alt%3D%22txnelson_0-1634639254977.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22txnelson_1-1634639283641.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22txnelson_1-1634639283641.png%22%20style%3D%22width%3A%20122px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22txnelson_1-1634639283641.png%22%20style%3D%22width%3A%20122px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F36823i243488D9F12739D0%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22txnelson_1-1634639283641.png%22%20alt%3D%22txnelson_1-1634639283641.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0ANew%20Window(%20%22Enter%20Script%22%2C%0A%20V%20List%20Box(%0A%20%20tb%20%3D%20Text%20Edit%20Box(%20%22%22%2C%20%26lt%3B%3CSET%20width%3D%22%22%3E%3C%2FSET%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
jemg
Level III

How to activate a button box with "desired script" from the text box.

As shown below, when the user inputs the desired script into the text box(ex. Distribution( Continuous Distribution( Column( :X) ) );)

and then executes the button box, how can the corresponding script be executed as analysis? Thanks for letting us know!

 

 

I want the script to be executed as analysis when the user inputs the desired script into the text box and then executes the button box as shown below.


How can I execute the text entered in the text box immediately with a button click?

CT_MG_0-1634630731843.png

 

Though I stored the desired script as a variable using get text() and write(), it is not executed as an analysis.
I would really appreciate it if you could tell me how to solve it.

MGO
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How to activate a button box with "desired script" from the text box.

Use the Eval(Parse()) combination of functions to execute a text string of JSL

txnelson_0-1634639254977.png

txnelson_1-1634639283641.png

Names Default To Here( 1 );
New Window( "Enter Script",
	V List Box(
		tb = Text Edit Box( "", <<set width( 400 ), <<set script( theScript = tb << get text ) ),
		OKButton = Button Box( "OK", Eval( Parse( theScript ) ) )
	)
);

 

 

Jim

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: How to activate a button box with "desired script" from the text box.

Use the Eval(Parse()) combination of functions to execute a text string of JSL

txnelson_0-1634639254977.png

txnelson_1-1634639283641.png

Names Default To Here( 1 );
New Window( "Enter Script",
	V List Box(
		tb = Text Edit Box( "", <<set width( 400 ), <<set script( theScript = tb << get text ) ),
		OKButton = Button Box( "OK", Eval( Parse( theScript ) ) )
	)
);

 

 

Jim
jemg
Level III

Re: How to activate a button box with "desired script" from the text box.

It works! 

Thanks all for your kindly help

MGO
ian_jmp
Level X

Re: How to activate a button box with "desired script" from the text box.

You need to look at the 'Parse()' function:

Names Default To Here( 1 );
txt = "x+y";
scr = Parse(txt);

x = 2; y = 3;
Print(scr);
Print(Eval(scr));

It feels like typing in a script this way would be quite error prone.

Recommended Articles