diff options
author | chriseth <chris@ethereum.org> | 2017-08-15 23:45:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-15 23:45:44 +0800 |
commit | 2fa59489b68c55e62c4b909dd8503863fb0afc03 (patch) | |
tree | c4f5dae829185bc0ceae18d98feea81862e5ea22 | |
parent | 8ee973f316932ffe39628cb22a9c330dfa0e0d2f (diff) | |
parent | a73fb4d52957317cd341ad1a126ce3a499889d7b (diff) | |
download | dexon-solidity-2fa59489b68c55e62c4b909dd8503863fb0afc03.tar.gz dexon-solidity-2fa59489b68c55e62c4b909dd8503863fb0afc03.tar.zst dexon-solidity-2fa59489b68c55e62c4b909dd8503863fb0afc03.zip |
Merge pull request #2664 from joshuahannan/develop
added while loop description
-rw-r--r-- | docs/assembly.rst | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/assembly.rst b/docs/assembly.rst index bdb708a9..6495699f 100644 --- a/docs/assembly.rst +++ b/docs/assembly.rst @@ -570,6 +570,20 @@ The following example computes the sum of an area in memory. } } +For loops can also be written so that they behave like while loops: +Simply leave the initialization and post-iteration parts empty. + +.. code:: + + { + let x := 0 + let i := 0 + for { } lt(i, 0x100) { } { // while(i < 0x100) + x := add(x, mload(i)) + i := add(i, 0x20) + } + } + Functions --------- |