cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
%3CLINGO-SUB%20id%3D%22lingo-sub-723593%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3EBucle%20for%3A%20establece%20la%20primera%2F%C3%BAltima%20entrada%20ejecutada%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-723593%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3E%E2%98%90%20Nueva%20caracter%C3%ADstica%20interesante%3CBR%20%2F%3E%20%E2%98%91%20%C2%A1podr%C3%ADa%20ayudar%20a%20muchos%20usuarios!%3C%2FP%3E%3CP%3E%E2%98%90%20elimina%20un%20%22error%22%3C%2FP%3E%3CP%3E%E2%98%90%20Es%20bueno%20tenerlo%3C%2FP%3E%3CP%3E%E2%98%90%20nadie%20lo%20necesita%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CSTRONG%3E%C2%BFQu%C3%A9%20inspir%C3%B3%20esta%20solicitud%20de%20lista%20de%20deseos%3F%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EDurante%20la%20depuraci%C3%B3n%20de%20un%20script%2C%20a%20menudo%20quiero%20examinar%20un%20bucle%20for%20y%20ejecutar%20el%20c%C3%B3digo%20paso%20a%20paso%20para%20uno%20de%20los%20elementos.%3C%2FP%3E%3CP%3ELo%20m%C3%A1s%20interesante%3A%20iniciar%20el%20bucle%20con%20el%20%C3%BAltimo%20valor%20%5Bpor%20ejemplo%2C%20despu%C3%A9s%20de%20un%20fallo%5D%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3ETodos%20los%20par%C3%A1metros%20ya%20est%C3%A1n%20configurados%20en%20la%20%C3%BAltima%20ejecuci%C3%B3n%2C%20solo%20falta%20el%20par%C3%A1metro%20de%20bucle.%20Por%20eso%20la%20mayor%C3%ADa%20de%20mis%20bucles%20for%20tienen%20este%20aspecto%3A%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EFor%20Each(%20%7Bmydt%7D%2C%20openTables%2C%0A%20%20%2F%2F%20mydt%20%3D%20openTables%5B13%5D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EEl%20c%C3%B3digo%20deshabilitado%20se%20puede%20ejecutar%20para%20establecer%20el%20par%C3%A1metro%20de%20bucle%20para%20la%20depuraci%C3%B3n.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CSTRONG%3E%C2%BFCu%C3%A1l%20es%20la%20mejora%20que%20le%20gustar%C3%ADa%20ver%3F%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EAgregue%20un%20comando%20al%20men%C3%BA%20contextual%20del%20bot%C3%B3n%20derecho%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22hogi_0-1707555632830.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22hogi_0-1707555632830.png%22%20style%3D%22width%3A%20369px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F61030i655A03ECDBB6B428%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22hogi_0-1707555632830.png%22%20alt%3D%22hogi_0-1707555632830.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%5Beditar%5D%20Plan%20B%3A%20simplemente%20copiar%20el%20comportamiento%20del%20bucle%20for()%3A%3CBR%20%2F%3E%20hacer%20que%20el%20par%C3%A1metro%20de%20bucle%20sea%20accesible%20desde%20fuera%20del%20bucle.%3CBR%20%2F%3E%20-%26gt%3B%20si%20el%20c%C3%B3digo%20se%20detiene%2C%20el%20par%C3%A1metro%20de%20bucle%20es%20el%20%C3%BAltimo%20del%20ciclo.%3CBR%20%2F%3E%20-%26gt%3B%20Genial%20para%20depurar%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CSTRONG%3E%C2%BFPor%20qu%C3%A9%20es%20importante%20esta%20idea%3F%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3ENo%20es%20importante%2C%20pero%20cualquier%20*)%20codificador%20JSL%20te%20amar%C3%A1.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fforums%2Fsearchpage%2Ftab%2Fmessage%3Ffilter%3Dlocation%2CauthorId%26amp%3Bq%3Dfeature%26amp%3Blocation%3Didea-board%3Ajmp-wish-list%26amp%3Bauthor_id%3D26800%22%20target%3D%22_self%22%3EM%C3%A1s%20deseos%20de%20%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22hogi_2-1702196401638.png%22%20style%3D%22width%3A%2036px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22hogi_2-1702196401638.png%22%20style%3D%22width%3A%2036px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F59505i92BA52D1289B6F5C%2Fimage-dimensions%2F36x39%3Fv%3Dv2%22%20width%3D%2236%22%20height%3D%2239%22%20role%3D%22button%22%20title%3D%22hogi_2-1702196401638.png%22%20alt%3D%22hogi_2-1702196401638.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FA%3E%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E*)%20Tal%20vez%20hab%C3%ADa%20una%20raz%C3%B3n%20para%20cambiar%20el%20comportamiento.%3CBR%20%2F%3E%20Entonces%3A%20tal%20vez%20no%20%3CU%3Etodos%3C%2FU%3E%20los%20codificadores%20JSL%20est%C3%A9n%20contentos%20de%20ver%20el%20comportamiento%20antiguo%20(%C2%BFobsoleto%3F).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-723593%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CLINGO-LABEL%3EAutomatizaci%C3%B3n%20y%20scripting%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-778848%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3ERe%3A%20Bucle%20for%3A%20establecer%20la%20primera%20entrada%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-778848%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3EMedio%20a%C3%B1o%20y%20solo%202%20Kudos.%3CBR%20%2F%3E%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F42584%22%20target%3D%22_blank%22%3E%40Sarah-Sylvestre%3C%2FA%3E%20%3CSPAN%3E%2C%20%C2%BFpodr%C3%ADas%20archivar%20este%20deseo%3F%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%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-798055%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Bucle%20for%3A%20establecer%20la%20primera%20entrada%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-798055%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F42584%22%20target%3D%22_blank%22%3E%40Sarah-Sylvestre%3C%2FA%3E%3CSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3Ebaja%20prioridad%20-%26gt%3B%20se%20pueden%20cerrar%20y%20reactivar%20una%20vez%20finalizadas%20las%20importantes.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-801198%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Bucle%20for%3A%20establecer%20la%20primera%20entrada%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-801198%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CBLOCKQUOTE%3E%3CHR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F26800%22%20target%3D%22_blank%22%3E%40hogi%3C%2FA%3E%20escribi%C3%B3%3A%3CBR%20%2F%3E%3CP%3E%20%3CEM%3ESolo%20falta%20el%20par%C3%A1metro%20de%20bucle.%3C%2FEM%3E%3C%2FP%3E%3CHR%20%2F%3E%3C%2FBLOCKQUOTE%3E%3CP%3E%C2%A1Ah%2C%20ahora%20lo%20entiendo!%3CBR%20%2F%3E%20%C2%A1Es%20una%20desventaja%20del%20bucle%20For%20each!%3CBR%20%2F%3E%3CBR%20%2F%3E%20Pit%C3%B3n%3A%3C%2FP%3E%3CPRE%3Efruits%20%3D%20%5B%22apple%22%2C%20%22banana%22%2C%20%22cherry%22%5D%0Afor%20x%20in%20fruits%3A%0A%20%20print(x)%0Aprint(%22__%22)%20%20%0Aprint(x)%3C%2FPRE%3E%3CP%3E-%26gt%3B%20obras%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EJSL%20%23%201%3A%20bucle%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3Efor()%3C%2FFONT%3E%20%3A%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20default%20to%20here(1)%3B%0A%0Afor(i%3D1%2Ci%26lt%3B3%2Ci%2B%2B%2C%201)%3B%0APrint(i)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E-%26gt%3B%20obras%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EJSL%20%232%3A%20bucle%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3Efor%20each()%3C%2FFONT%3E%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20default%20to%20here(1)%3B%0A%0Afor%20each(%7Bj%7D%2C%201%3A%3A10%2CPrint(j))%3B%0APrint(j)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E-%26gt%3B%20falla%3A%20j%20no%20est%C3%A1%20definido%20fuera%20del%20bucle%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3Efor%20each()%3C%2FFONT%3E%3CBR%20%2F%3E%20-%26gt%3B%20dificulta%20la%20depuraci%C3%B3n%20del%20c%C3%B3digo%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar

For loop: set first / last executed entry

☐ cool new feature
☑ could help many users!

☐ removes a „bug“

☐ nice to have

☐ nobody needs it

 

What inspired this wish list request? 

During script debugging, I often want to look into a for loop and execute the code step by step for one of the items.

Most interesting: start the loop with the last value [e.g. after a failure]

 

 

All parameters are already set by the last run, just the looping parameter is missing. This is why most of my for loops look like this:

 

For Each( {mydt}, openTables,
  // mydt = openTables[13]

the disabled code can be executed to set the looping parameter for debugging.

 

 

What is the improvement you would like to see? 

Please add a command to the right click context menu:

hogi_0-1707555632830.png

 

[edit] plan B: Just copy the behavior of the for() loop:
make the looping parameter accessible from outside the loop.
-> if the code stops, the looping parameter is the last one in the cycle.
-> great for debugging

 

Why is this idea important? 

It's not important, but every *) JSL coder will love you.

 

more wishes by  hogi_2-1702196401638.png

 

*) maybe there was a reason to change the behavior.
So: maybe not every  JSL coder is happy to see the old (deprecated?) behavior.

3 Comments
hogi
Level XII

half a year and just 2 Kudos.
@Sarah-Sylvestre , could you please archive this wish : )

hogi
Level XII

@Sarah-Sylvestre 
low prio -> can be closed and reactivated once the important ones are finished.

hogi
Level XII

@hogi wrote:

just the looping parameter is missing.


Ah, now I got it!
It's a disadvantage of the For each loop!

Python:

fruits = ["apple", "banana", "cherry"]
for x in fruits:
  print(x)
print("__")  
print(x)

-> works

 

JSL # 1: for() loop:

Names default to here(1);

for(i=1,i<3,i++, 1);
Print(i);

-> works

 

JSL #2: for each() loop

Names default to here(1);

for each({j}, 1::10,Print(j));
Print(j);

-> fails : j is not defined outside of the for each() loop 
-> makes it difficult to debug the code