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%3ECiclo%20For%3A%20imposta%20la%20prima%2Fultima%20voce%20eseguita%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%20nuova%20fantastica%20funzionalit%C3%A0%3CBR%20%2F%3E%20%E2%98%91%20potrebbe%20aiutare%20molti%20utenti!%3C%2FP%3E%3CP%3E%E2%98%90%20rimuove%20un%20%22bug%22%3C%2FP%3E%3CP%3E%E2%98%90%20bello%20da%20avere%3C%2FP%3E%3CP%3E%E2%98%90%20nessuno%20ne%20ha%20bisogno%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CSTRONG%3ECosa%20ti%20ha%20ispirato%20a%20richiedere%20questa%20lista%20dei%20desideri%3F%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EDurante%20il%20debug%20dello%20script%2C%20spesso%20voglio%20esaminare%20un%20ciclo%20for%20ed%20eseguire%20il%20codice%20passo%20dopo%20passo%20per%20uno%20degli%20elementi.%3C%2FP%3E%3CP%3EPi%C3%B9%20interessante%3A%20avviare%20il%20ciclo%20con%20l'ultimo%20valore%20%5Bad%20esempio%20dopo%20un%20errore%5D%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3ETutti%20i%20parametri%20sono%20gi%C3%A0%20impostati%20dall'ultima%20esecuzione%2C%20manca%20solo%20il%20parametro%20looping.%20Ecco%20perch%C3%A9%20la%20maggior%20parte%20dei%20miei%20cicli%20for%20sono%20cos%C3%AC%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%3Eil%20codice%20disabilitato%20pu%C3%B2%20essere%20eseguito%20per%20impostare%20il%20parametro%20di%20loop%20per%20il%20debug.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CSTRONG%3EQuale%20miglioramento%20vorresti%20vedere%3F%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EAggiungere%20un%20comando%20al%20menu%20contestuale%20del%20tasto%20destro%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%5Bmodifica%5D%20piano%20B%3A%20basta%20copiare%20il%20comportamento%20del%20ciclo%20for()%3A%3CBR%20%2F%3E%20rendere%20il%20parametro%20di%20looping%20accessibile%20dall'esterno%20del%20loop.%3CBR%20%2F%3E%20-%26gt%3B%20se%20il%20codice%20si%20interrompe%2C%20il%20parametro%20del%20ciclo%20%C3%A8%20l'ultimo.%3CBR%20%2F%3E%20-%26gt%3B%20ottimo%20per%20il%20debug%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CSTRONG%3EPerch%C3%A9%20questa%20idea%20%C3%A8%20importante%3F%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3ENon%20%C3%A8%20importante%2C%20ma%20ogni%20*)%20programmatore%20JSL%20ti%20adorer%C3%A0.%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%3Epi%C3%B9%20desideri%20da%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*)%20Forse%20c'era%20una%20ragione%20per%20cambiare%20comportamento.%3CBR%20%2F%3E%20Quindi%3A%20forse%20non%20%3CU%3Etutti%3C%2FU%3E%20i%20programmatori%20JSL%20sono%20contenti%20di%20vedere%20il%20vecchio%20comportamento%20(obsoleto%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%3EAutomazione%20e%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%20Ciclo%20for%3A%20imposta%20la%20prima%20voce%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-778848%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3Esei%20mesi%20e%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%20potresti%20archiviare%20questo%20desiderio%3F%20%3A%20)%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%20Ciclo%20for%3A%20imposta%20la%20prima%20voce%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%3Ebassa%20priorit%C3%A0%20-%26gt%3B%20pu%C3%B2%20essere%20chiusa%20e%20riattivata%20una%20volta%20terminate%20quelle%20importanti.%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%20Ciclo%20for%3A%20imposta%20la%20prima%20voce%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%20ha%20scritto%3A%3CBR%20%2F%3E%3CP%3E%20%3CEM%3Emanca%20solo%20il%20parametro%20loop.%3C%2FEM%3E%3C%2FP%3E%3CHR%20%2F%3E%3C%2FBLOCKQUOTE%3E%3CP%3EAh%2C%20adesso%20ho%20capito!%3CBR%20%2F%3E%20%C3%88%20uno%20svantaggio%20del%20ciclo%20For%20each!%3CBR%20%2F%3E%3CBR%20%2F%3E%20Pitone%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%20funziona%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EJSL%20%23%201%3A%20ciclo%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%20funziona%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EJSL%20%232%3A%20ciclo%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%20fallisce%3A%20j%20non%20%C3%A8%20definito%20al%20di%20fuori%20del%20ciclo%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3Efor%20each()%3C%2FFONT%3E%3CBR%20%2F%3E%20-%26gt%3B%20rende%20difficile%20il%20debug%20del%20codice%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