Update while.adoc#821
Open
Graybeard2ca wants to merge 1 commit into
Open
Conversation
None of the While or While Loop explanations or tutorials make it entirely clear how the loop ends or what happens when it does end, and I've puzzled over this for some time. Also, some comparison is needed between If, While, Do While, and For to clarify what each is best for and when best to use them. Also, NONE of these While explanations or tutorials mentions that you can use <break> to get out of them early. An example using Break would be good on this page, too, such as using a sensor reading to interrupt the While before it's finished. Let's say, while a switch is open, keep running a motor until the switch closes. Can do this with If statement, how is while better?
Author
|
that you can use Break to get out of them early. |
Author
|
Sorry, clicked wrong control. |
|
|
Author
|
I tried to sign the CLA but the link doesn't work. |
Author
|
I have tried to sign the CLA. The link goes to https://cla-assistant.io/arduino/reference-en?pullRequest=821 but the field is locked and I can't enter data. There are no other controls on the page. |
per1234
requested changes
May 7, 2022
|
|
||
| [role="language"] | ||
|
|
||
| https://www.arduino.cc/reference/en/language/structure/control-structure/break/[Break^] |
Collaborator
There was a problem hiding this comment.
Suggested change
| https://www.arduino.cc/reference/en/language/structure/control-structure/break/[Break^] | |
| * #LANGUAGE# link:../break[break] | |
- Make clickable relative link
- Follow standard style conventions for reference links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
None of the While or While Loop explanations or tutorials make it entirely clear how the loop ends or what happens when it does end, and I've puzzled over this for some time. Also, some comparison is needed between If, While, Do While, and For to clarify what each is best for and when best to use them.
Also, NONE of these While explanations or tutorials mentions that you can use to get out of them early. An example using Break would be good on this page, too, such as using a sensor reading to interrupt the While before it's finished. Let's say, while a switch is open, keep running a motor until the switch closes. Can do this with If statement, how is while better?
There is one While Loop tutorial but it's far more complicated than necessary for a basic explanation.