diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-09-09 15:24:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-09 15:24:34 +0200 |
commit | e4a8b472cf3902d903281907f05b3cdbd20b6a6e (patch) | |
tree | afe8501dc0573520444e035e8cd5ff2ede969e4d | |
parent | a63ac0f8e04a7a953bebe247908573c530548609 (diff) | |
parent | 263f620421773e74a0d5c0306c1453883dc205bb (diff) |
Merge pull request #41812 from Calinou/doc-array-errors
Improve documentation related to Array error handling
-rw-r--r-- | doc/classes/Array.xml | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 61df5e092e..20579e0159 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -119,7 +119,8 @@ <return type="Variant"> </return> <description> - Returns the last element of the array. Throws an error and returns [code]null[/code] if the array is empty. + Returns the last element of the array. Prints an error and returns [code]null[/code] if the array is empty. + [b]Note:[/b] Calling this function is not the same as writing [code]array[-1][/code]. If the array is empty, accessing by index will pause project execution when running from the editor. </description> </method> <method name="bsearch"> @@ -216,7 +217,8 @@ <return type="Variant"> </return> <description> - Returns the first element of the array. Throws an error and returns [code]null[/code] if the array is empty. + Returns the first element of the array. Prints an error and returns [code]null[/code] if the array is empty. + [b]Note:[/b] Calling this function is not the same as writing [code]array[0][/code]. If the array is empty, accessing by index will pause project execution when running from the editor. </description> </method> <method name="has"> @@ -283,14 +285,14 @@ <return type="Variant"> </return> <description> - Removes and returns the last element of the array. Returns [code]null[/code] if the array is empty. + Removes and returns the last element of the array. Returns [code]null[/code] if the array is empty, without printing an error message. </description> </method> <method name="pop_front"> <return type="Variant"> </return> <description> - Removes and returns the first element of the array. Returns [code]null[/code] if the array is empty. + Removes and returns the first element of the array. Returns [code]null[/code] if the array is empty, wwithout printing an error message. </description> </method> <method name="push_back"> @@ -317,7 +319,7 @@ <argument index="0" name="position" type="int"> </argument> <description> - Removes an element from the array by index. + Removes an element from the array by index. If the index does not exist in the array, nothing happens. </description> </method> <method name="resize"> |