diff options
author | Joshua Hannan <hannanjoshua19@gmail.com> | 2017-07-30 07:15:54 +0800 |
---|---|---|
committer | Joshua Hannan <hannanjoshua19@gmail.com> | 2017-07-30 07:15:54 +0800 |
commit | 5f9c02c6b6e78ec80a5b8c2e6a467bb89b9a9454 (patch) | |
tree | 8955cde67afcff96e26303809a1b6cd29e0228ef /docs | |
parent | 53f747b7ded3610802582448257b25e87442bebb (diff) | |
download | dexon-solidity-5f9c02c6b6e78ec80a5b8c2e6a467bb89b9a9454.tar.gz dexon-solidity-5f9c02c6b6e78ec80a5b8c2e6a467bb89b9a9454.tar.zst dexon-solidity-5f9c02c6b6e78ec80a5b8c2e6a467bb89b9a9454.zip |
added while loop description
Diffstat (limited to 'docs')
-rw-r--r-- | docs/assembly.rst | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/assembly.rst b/docs/assembly.rst index 4e665b7e..a56e9cc1 100644 --- a/docs/assembly.rst +++ b/docs/assembly.rst @@ -545,6 +545,21 @@ The following example computes the sum of an area in memory. } } +With the for loop header, it is also possible to declare it so it behaves +like a while loop. 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 --------- |