-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
While loops and try/except examples #3
base: gh-pages
Are you sure you want to change the base?
Conversation
Examples/FOR_Loops/3_in_range.robot
Outdated
FOR ${num} IN RANGE 10 | ||
Log To Console ${num} | ||
END | ||
|
||
Loop 10 times starting with 1 | ||
Log To Console start: 1 ,inc: 1 , end:11 | ||
Log To Console start: 1 ,inc: 1 , end:10 | ||
FOR ${num} IN RANGE 1 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ich glaub hier müsste eher das IN RANGE geändert werden, oder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loop 10 times starting with 1
Log To Console start: 1 ,inc: 1 , end:11
FOR ${num} IN RANGE 1 11
Log To Console ${num}
END
oder eben 9 times
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oder so. end im Log To Console muss dann aber trotzdem 10 sein, weil das Ende im IN RANGE ja exklusiv ist
Loop 10 times starting with 1
Log To Console start: 1 ,inc: 1 , end:10
FOR ${num} IN RANGE 1 11
Log To Console ${num}
END
Log To Console ${num} | ||
Exit For Loop If ${num} == 0 | ||
Sleep 1sec | ||
END | ||
Log To Console 🎉🥳 HAPPY NEW YEAR !!! 🍾 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wenn du es bei 0 enden lässt, kommt die 0 nie.
Die Idee hier war auch das Exit bzw BREAK zu zeigen.
Ich würde es so ändern.
Countdown from 10 to 0 in 10 seconds
Log To Console start: 10 ,inc: -1 , end: -1
FOR ${num} IN RANGE 10 -1 -1
Log To Console ${num}
IF ${num} == 0 BREAK
Sleep 1sec
END
Log To Console 🎉🥳 HAPPY NEW YEAR !!! 🍾
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kannst ja in die [Documentation] kurz reinschreiben, dass eine FOR Loop auch abgebrochen werden kann. " can conditionally be exited"
Examples/FOR_Loops/4_in_zip.robot
Outdated
Log To Console ${first} ${last} | ||
END | ||
|
||
Combines two loops of different lengths |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Combines two lists of different lengths
No description provided.