Merge pull request #2664 from joshuahannan/develop

added while loop description
This commit is contained in:
chriseth 2017-08-15 17:45:44 +02:00 committed by GitHub
commit 2fa59489b6

View File

@ -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
---------