aboutsummaryrefslogtreecommitdiffstats
path: root/docs/source/arduino/goto.rst
diff options
context:
space:
mode:
authorPerry Hung <iperry@gmail.com>2011-01-24 23:23:29 -0500
committerPerry Hung <iperry@gmail.com>2011-01-24 23:23:29 -0500
commitc48689d34809943a5907884bd287cea9ae275352 (patch)
treed49ff06b0d4b81f6ab0eac8060d178ce7542476c /docs/source/arduino/goto.rst
parent64431fd4b59cb8656365f1fad5f679cd4d756239 (diff)
parenta9b2d70bc7799ca96c1673b18fe3012b1a4dd329 (diff)
downloadlibrambutan-c48689d34809943a5907884bd287cea9ae275352.tar.gz
librambutan-c48689d34809943a5907884bd287cea9ae275352.zip
Merge remote branch 'leaf/master'
Diffstat (limited to 'docs/source/arduino/goto.rst')
-rw-r--r--docs/source/arduino/goto.rst55
1 files changed, 0 insertions, 55 deletions
diff --git a/docs/source/arduino/goto.rst b/docs/source/arduino/goto.rst
deleted file mode 100644
index 1fcceb7..0000000
--- a/docs/source/arduino/goto.rst
+++ /dev/null
@@ -1,55 +0,0 @@
-.. _arduino-goto:
-
-goto
-====
-
-Transfers program flow to a labeled point in the program
-
-
-
-Syntax
-------
-
-label:
-
-
-
-goto label; // sends program flow to the label
-
-
-
-Tip
----
-
-The use of *goto* is discouraged in C programming, and some authors
-of C programming books claim that the *goto* statement is never
-necessary, but used judiciously, it can simplify certain programs.
-The reason that many programmers frown upon the use of *goto* is
-that with the unrestrained use of *goto* statements, it is easy to
-create a program with undefined program flow, which can never be
-debugged.
-
-
-
-With that said, there are instances where a goto statement can come
-in handy, and simplify coding. One of these situations is to break
-out of deeply nested *for* loops, or *if* logic blocks, on a
-certain condition.
-
-
-
-Example
--------
-
-::
-
- for(byte r = 0; r < 255; r++){
- for(byte g = 255; g > -1; g--){
- for(byte b = 0; b < 255; b++){
- if (analogRead(0) > 250){ goto bailout;}
- // more statements ...
- }
- }
- }
- bailout:
-