aboutsummaryrefslogtreecommitdiffstats
path: root/docs/source/arduino/switchcase.rst
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@mit.edu>2010-12-21 10:27:37 -0500
committerMarti Bolivar <mbolivar@mit.edu>2010-12-21 10:27:37 -0500
commitc45bccad44187da27505cf5808424e709e3f54a1 (patch)
tree18a459a50f8d0551ba046e30462c93999d982725 /docs/source/arduino/switchcase.rst
parent84fd2532a7f23d20354ff590790b3f892cb7e7d7 (diff)
parentd5ad2a27f4e69e6cc9324331945937c983c30366 (diff)
downloadlibrambutan-c45bccad44187da27505cf5808424e709e3f54a1.tar.gz
librambutan-c45bccad44187da27505cf5808424e709e3f54a1.zip
Merge branch 'master' into debug-serialusb.
Chose debug-serialusb version in cases of conflict. Conflicts: libmaple/usb/usb_callbacks.c
Diffstat (limited to 'docs/source/arduino/switchcase.rst')
-rw-r--r--docs/source/arduino/switchcase.rst77
1 files changed, 0 insertions, 77 deletions
diff --git a/docs/source/arduino/switchcase.rst b/docs/source/arduino/switchcase.rst
deleted file mode 100644
index 28791eb..0000000
--- a/docs/source/arduino/switchcase.rst
+++ /dev/null
@@ -1,77 +0,0 @@
-.. _arduino-switchcase:
-
-switch / case statements
-========================
-
-Like **if** statements, **switch...case** controls the flow of
-programs by allowing programmers to specify different code that
-should be executed in various conditions. In particular, a switch
-statement compares the value of a variable to the values specified
-in case statements. When a case statement is found whose value
-matches that of the variable, the code in that case statement is
-run.
-
-
-
-The **break** keyword exits the switch statement, and is typically
-used at the end of each case. Without a break statement, the switch
-statement will continue executing the following expressions
-("falling-through") until a break, or the end of the switch
-statement is reached.
-
-
-
-Example
-~~~~~~~
-
-::
-
- switch (var) {
- case 1:
- //do something when var equals 1
- break;
- case 2:
- //do something when var equals 2
- break;
- default:
- // if nothing else matches, do the default
- // default is optional
- }
-
-
-
-Syntax
-~~~~~~
-
-::
-
- switch (var) {
- case label:
- // statements
- break;
- case label:
- // statements
- break;
- default:
- // statements
- }
-
-
-
-Parameters
-~~~~~~~~~~
-
-var: the variable whose value to compare to the various cases
-
-
-
-label: a value to compare the variable to
-
-
-
-See also:
----------
-
-`if...else <http://arduino.cc/en/Reference/Else>`_
-
-