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%3EFor-Schleife%3A%20ersten%20%2F%20letzten%20ausgef%C3%BChrten%20Eintrag%20setzen%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%20cooles%20neues%20Feature%3CBR%20%2F%3E%20%E2%98%91%20k%C3%B6nnte%20vielen%20Benutzern%20helfen!%3C%2FP%3E%3CP%3E%E2%98%90%20behebt%20einen%20%E2%80%9EBug%E2%80%9C%3C%2FP%3E%3CP%3E%E2%98%90%20sch%C3%B6n%20zu%20haben%3C%2FP%3E%3CP%3E%E2%98%90%20niemand%20braucht%20es%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CSTRONG%3EWas%20hat%20Sie%20zu%20dieser%20Wunschliste%20inspiriert%3F%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EBeim%20Skript-Debuggen%20m%C3%B6chte%20ich%20h%C3%A4ufig%20in%20eine%20For-Schleife%20schauen%20und%20den%20Code%20f%C3%BCr%20eines%20der%20Elemente%20Schritt%20f%C3%BCr%20Schritt%20ausf%C3%BChren.%3C%2FP%3E%3CP%3EAm%20interessantesten%3A%20Starten%20Sie%20die%20Schleife%20mit%20dem%20letzten%20Wert%20%5BzB%20nach%20einem%20Fehler%5D%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EAlle%20Parameter%20sind%20bereits%20beim%20letzten%20Durchlauf%20gesetzt%2C%20es%20fehlt%20nur%20noch%20der%20Schleifenparameter.%20Deshalb%20sehen%20die%20meisten%20meiner%20For-Schleifen%20so%20aus%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%3EDer%20deaktivierte%20Code%20kann%20ausgef%C3%BChrt%20werden%2C%20um%20den%20Loop-Parameter%20zum%20Debuggen%20festzulegen.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CSTRONG%3EWelche%20Verbesserung%20w%C3%BCrden%20Sie%20gerne%20sehen%3F%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EBitte%20f%C3%BCgen%20Sie%20dem%20Rechtsklick-Kontextmen%C3%BC%20einen%20Befehl%20hinzu%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%5BBearbeiten%5D%20Plan%20B%3A%20Kopieren%20Sie%20einfach%20das%20Verhalten%20der%20for()-Schleife%3A%3CBR%20%2F%3E%20Machen%20Sie%20den%20Schleifenparameter%20von%20au%C3%9Ferhalb%20der%20Schleife%20zug%C3%A4nglich.%3CBR%20%2F%3E%20-%26gt%3B%20wenn%20der%20Code%20stoppt%2C%20ist%20der%20Schleifenparameter%20der%20letzte%20im%20Zyklus.%3CBR%20%2F%3E%20-%26gt%3B%20ideal%20zum%20Debuggen%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CSTRONG%3EWarum%20ist%20diese%20Idee%20wichtig%3F%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EEs%20ist%20nicht%20wichtig%2C%20aber%20jeder%20*)%20JSL-Programmierer%20wird%20Sie%20lieben.%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%3Emehr%20W%C3%BCnsche%20von%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*)%20Vielleicht%20gab%20es%20einen%20Grund%2C%20das%20Verhalten%20zu%20%C3%A4ndern.%3CBR%20%2F%3E%20Also%3A%20Vielleicht%20ist%20nicht%20%3CU%3Ejeder%3C%2FU%3E%20JSL-Programmierer%20gl%C3%BCcklich%2C%20das%20alte%20(veraltete%3F)%20Verhalten%20zu%20sehen.%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%3EAutomatisierung%20und%20Skripting%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%3EBetreff%3A%20For-Schleife%3A%20ersten%20Eintrag%20setzen%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-778848%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3Eein%20halbes%20Jahr%20und%20nur%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%20k%C3%B6nntest%20du%20diesen%20Wunsch%20bitte%20archivieren%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%3EBetreff%3A%20For-Schleife%3A%20ersten%20Eintrag%20setzen%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%3Eniedrige%20Priorit%C3%A4t%20-%26gt%3B%20kann%20geschlossen%20und%20erneut%20aktiviert%20werden%2C%20sobald%20die%20wichtigen%20abgeschlossen%20sind.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-801198%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EBetreff%3A%20For-Schleife%3A%20ersten%20Eintrag%20setzen%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%20schrieb%3A%3CBR%20%2F%3E%3CP%3E%20%3CEM%3Ees%20fehlt%20lediglich%20der%20Looping-Parameter.%3C%2FEM%3E%3C%2FP%3E%3CHR%20%2F%3E%3C%2FBLOCKQUOTE%3E%3CP%3EAh%2C%20jetzt%20habe%20ich%20es%20verstanden!%3CBR%20%2F%3E%20Das%20ist%20ein%20Nachteil%20der%20For-each-Schleife!%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%20funktioniert%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EJSL%20Nr.%201%3A%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3Efor()%3C%2FFONT%3E%20-Schleife%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%20funktioniert%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EJSL%20Nr.%202%3A%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3Ef%C3%BCr%20jede()%3C%2FFONT%3E%20-Schleife%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%20schl%C3%A4gt%20fehl%3A%20j%20ist%20nicht%20au%C3%9Ferhalb%20der%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3Efor%20each()-%3C%2FFONT%3E%20Schleife%20definiert%3CBR%20%2F%3E%20-%26gt%3B%20erschwert%20das%20Debuggen%20des%20Codes%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