diff options
author | chriseth <chris@ethereum.org> | 2018-11-26 22:19:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-26 22:19:55 +0800 |
commit | f1cebed998cd805cec3f37d42a18f3632399b866 (patch) | |
tree | 00b264409703b5c5bdb134c89e60af8e67592bc2 /docs | |
parent | e7f6ed8f5ce2fccef61d34ad199ab9cc1b281cde (diff) | |
parent | 58181e8df9c2cb3401e02d0533ba6c2c0a2bde6a (diff) | |
download | dexon-solidity-f1cebed998cd805cec3f37d42a18f3632399b866.tar.gz dexon-solidity-f1cebed998cd805cec3f37d42a18f3632399b866.tar.zst dexon-solidity-f1cebed998cd805cec3f37d42a18f3632399b866.zip |
Merge pull request #5287 from ethereum/docs-update-input-parameters
DOCS: Merge FAQ into docs on multi-dimensional arrays
Diffstat (limited to 'docs')
-rw-r--r-- | docs/control-structures.rst | 16 | ||||
-rw-r--r-- | docs/frequently-asked-questions.rst | 5 |
2 files changed, 15 insertions, 6 deletions
diff --git a/docs/control-structures.rst b/docs/control-structures.rst index 889fbdb9..720b7084 100644 --- a/docs/control-structures.rst +++ b/docs/control-structures.rst @@ -30,6 +30,16 @@ with two integers, you would use something like:: Function parameters can be used as any other local variable and they can also be assigned to. +.. note:: + + An :ref:`external function<external-function-calls>` cannot accept a + multi-dimensional array as an input + parameter. This functionality is possible if you enable the new + experimental ``ABIEncoderV2`` feature by adding ``pragma experimental ABIEncoderV2;`` to your source file. + + An :ref:`internal function<external-function-calls>` can accept a + multi-dimensional array without enabling the feature. + .. index:: return array, return string, array, string, array of strings, dynamic array, variably sized array, return struct, struct Return Variables @@ -56,7 +66,7 @@ two integers passed as function parameters, then you use something like:: The names of return variables can be omitted. Return variables can be used as any other local variable and they -are zero-initialized. If they are not explicitly +are initialized with their :ref:`default value <default-value>` and have that value unless explicitly set. set, they stay zero value. You can either explicitly assign to return variables and @@ -122,6 +132,8 @@ the same as the number of return types. Function Calls ============== +.. _internal-function-calls: + Internal Function Calls ----------------------- @@ -143,6 +155,8 @@ contract can be called internally. You should still avoid excessive recursion, as every internal function call uses up at least one stack slot and there are at most 1024 slots available. +.. _external-function-calls: + External Function Calls ----------------------- diff --git a/docs/frequently-asked-questions.rst b/docs/frequently-asked-questions.rst index 9cc08822..bcdfdcd8 100644 --- a/docs/frequently-asked-questions.rst +++ b/docs/frequently-asked-questions.rst @@ -269,11 +269,6 @@ to create an independent copy of the storage value in memory. On the other hand, ``h(x)`` successfully modifies ``x`` because only a reference and not a copy is passed. -Is it possible to return an array of strings (``string[]``) from a Solidity function? -===================================================================================== - -Only when ``pragma experimental "ABIEncoderV2";`` is used. - What does the following strange check do in the Custom Token contract? ====================================================================== |