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%3EBoucle%20for%20%3A%20d%C3%A9finir%20la%20premi%C3%A8re%2Fderni%C3%A8re%20entr%C3%A9e%20ex%C3%A9cut%C3%A9e%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%20nouvelle%20fonctionnalit%C3%A9%20int%C3%A9ressante%3CBR%20%2F%3E%20%E2%98%91%20pourrait%20aider%20de%20nombreux%20utilisateurs%20!%3C%2FP%3E%3CP%3E%E2%98%90%20supprime%20un%20%C2%AB%20bug%20%C2%BB%3C%2FP%3E%3CP%3E%E2%98%90%20agr%C3%A9able%20%C3%A0%20avoir%3C%2FP%3E%3CP%3E%E2%98%90%20personne%20n'en%20a%20besoin%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CSTRONG%3EQu'est-ce%20qui%20a%20inspir%C3%A9%20cette%20demande%20de%20liste%20de%20souhaits%20%3F%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3ELors%20du%20d%C3%A9bogage%20d'un%20script%2C%20je%20souhaite%20souvent%20examiner%20une%20boucle%20for%20et%20ex%C3%A9cuter%20le%20code%20%C3%A9tape%20par%20%C3%A9tape%20pour%20l'un%20des%20%C3%A9l%C3%A9ments.%3C%2FP%3E%3CP%3ELe%20plus%20int%C3%A9ressant%20%3A%20d%C3%A9marrer%20la%20boucle%20avec%20la%20derni%C3%A8re%20valeur%20%5Bpar%20exemple%20apr%C3%A8s%20un%20%C3%A9chec%5D%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3ETous%20les%20param%C3%A8tres%20sont%20d%C3%A9j%C3%A0%20d%C3%A9finis%20lors%20de%20la%20derni%C3%A8re%20ex%C3%A9cution%2C%20seul%20le%20param%C3%A8tre%20de%20boucle%20manque.%20C'est%20pourquoi%20la%20plupart%20de%20mes%20boucles%20for%20ressemblent%20%C3%A0%20ceci%26nbsp%3B%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%3Ele%20code%20d%C3%A9sactiv%C3%A9%20peut%20%C3%AAtre%20ex%C3%A9cut%C3%A9%20pour%20d%C3%A9finir%20le%20param%C3%A8tre%20de%20boucle%20pour%20le%20d%C3%A9bogage.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CSTRONG%3EQuelle%20am%C3%A9lioration%20souhaiteriez-vous%20voir%20%3F%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EVeuillez%20ajouter%20une%20commande%20au%20menu%20contextuel%20du%20clic%20droit%26nbsp%3B%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%5Bmodifier%5D%20plan%20B%20%3A%20Copiez%20simplement%20le%20comportement%20de%20la%20boucle%20for()%20%3A%3CBR%20%2F%3E%20rendre%20le%20param%C3%A8tre%20de%20boucle%20accessible%20depuis%20l'ext%C3%A9rieur%20de%20la%20boucle.%3CBR%20%2F%3E%20-%26gt%3B%20si%20le%20code%20s'arr%C3%AAte%2C%20le%20param%C3%A8tre%20de%20boucle%20est%20le%20dernier%20du%20cycle.%3CBR%20%2F%3E%20-%26gt%3B%20id%C3%A9al%20pour%20le%20d%C3%A9bogage%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CSTRONG%3EPourquoi%20cette%20id%C3%A9e%20est-elle%20importante%20%3F%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3ECe%20n%E2%80%99est%20pas%20important%2C%20mais%20tous%20les%20codeurs%20JSL%20*)%20vous%20aimeront.%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%3Eplus%20de%20souhaits%20par%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*)%20peut-%C3%AAtre%20qu'il%20y%20avait%20une%20raison%20de%20changer%20le%20comportement.%3CBR%20%2F%3E%20Donc%20%3A%20peut-%C3%AAtre%20que%20%3CU%3Etous%3C%2FU%3E%20les%20codeurs%20JSL%20ne%20sont%20pas%20contents%20de%20voir%20l%E2%80%99ancien%20comportement%20(obsol%C3%A8te%26nbsp%3B%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%3EAutomatisation%20et%20scripts%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%20Boucle%20For%20%3A%20d%C3%A9finir%20la%20premi%C3%A8re%20entr%C3%A9e%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-778848%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3Esix%20mois%20et%20seulement%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%20pourriez-vous%20s'il%20vous%20pla%C3%AEt%20archiver%20ce%20souhait%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%20Boucle%20For%20%3A%20d%C3%A9finir%20la%20premi%C3%A8re%20entr%C3%A9e%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%3Efaible%20priorit%C3%A9%20-%26gt%3B%20peut%20%C3%AAtre%20ferm%C3%A9%20et%20r%C3%A9activ%C3%A9%20une%20fois%20les%20importants%20termin%C3%A9s.%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%20Boucle%20For%20%3A%20d%C3%A9finir%20la%20premi%C3%A8re%20entr%C3%A9e%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%20a%20%C3%A9crit%20%3A%3CBR%20%2F%3E%3CP%3E%20%3CEM%3Eil%20manque%20juste%20le%20param%C3%A8tre%20de%20boucle.%3C%2FEM%3E%3C%2FP%3E%3CHR%20%2F%3E%3C%2FBLOCKQUOTE%3E%3CP%3EAh%2C%20maintenant%20je%20l'ai%20compris%20!%3CBR%20%2F%3E%20C'est%20un%20inconv%C3%A9nient%20de%20la%20boucle%20For%20each%26nbsp%3B!%3CBR%20%2F%3E%3CBR%20%2F%3E%20Python%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%20travaux%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EJSL%20%23%201%20%3A%20boucle%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%20travaux%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EJSL%20%232%20%3A%20boucle%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%20%C3%A9choue%20%3A%20j%20n'est%20pas%20d%C3%A9fini%20en%20dehors%20de%20la%20boucle%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3Efor%20each()%3C%2FFONT%3E%3CBR%20%2F%3E%20-%26gt%3B%20rend%20difficile%20le%20d%C3%A9bogage%20du%20code%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