From 54f83f3640373a05891621db40a758490225a2f8 Mon Sep 17 00:00:00 2001 From: George Peter Banyard Date: Tue, 26 Sep 2023 20:29:29 +0100 Subject: [PATCH 1/2] Document str_increment() and str_decrement() --- reference/strings/functions/str-decrement.xml | 135 ++++++++++++++++++ reference/strings/functions/str-increment.xml | 131 +++++++++++++++++ reference/strings/versions.xml | 2 + 3 files changed, 268 insertions(+) create mode 100644 reference/strings/functions/str-decrement.xml create mode 100644 reference/strings/functions/str-increment.xml diff --git a/reference/strings/functions/str-decrement.xml b/reference/strings/functions/str-decrement.xml new file mode 100644 index 000000000000..2f73da230098 --- /dev/null +++ b/reference/strings/functions/str-decrement.xml @@ -0,0 +1,135 @@ + + + + str_decrement + Decrement an alphanumeric string + + + + &reftitle.description; + + stringstr_decrement + stringstring + + + Returns the decremented alphanumeric ASCII + string. + + + + + &reftitle.parameters; + + + + string + + + The input string. + + + + + + + + + &reftitle.returnvalues; + + Returns the decremented alphanumeric ASCII string. + + + + + &reftitle.errors; + + A ValueError is thrown if + string is empty. + + + A ValueError is thrown if + string is not an alphanumeric + ASCII string. + + + A ValueError is thrown if + string is out of the decrement range. + + + + + &reftitle.examples; + + + Basic <function>str_decrement</function> example + + +]]> + + &example.outputs; + + + + + + + + <function>str_decrement</function> example with a carry + + +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + str_increment + + + + + + diff --git a/reference/strings/functions/str-increment.xml b/reference/strings/functions/str-increment.xml new file mode 100644 index 000000000000..af5049302f12 --- /dev/null +++ b/reference/strings/functions/str-increment.xml @@ -0,0 +1,131 @@ + + + + str_increment + Increment an alphanumeric string + + + + &reftitle.description; + + stringstr_increment + stringstring + + + Returns the incremented alphanumeric ASCII + string. + + + + + &reftitle.parameters; + + + + string + + + The input string. + + + + + + + + + &reftitle.returnvalues; + + Returns the incremented alphanumeric ASCII string. + + + + + &reftitle.errors; + + A ValueError is thrown if + string is empty. + + + A ValueError is thrown if + string is not an alphanumeric + ASCII string. + + + + + &reftitle.examples; + + + Basic <function>str_increment</function> example + + +]]> + + &example.outputs; + + + + + + + + <function>str_increment</function> example with a carry + + +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + str_decrement + + + + + + diff --git a/reference/strings/versions.xml b/reference/strings/versions.xml index bf165edcdfe2..469c11f82b7f 100644 --- a/reference/strings/versions.xml +++ b/reference/strings/versions.xml @@ -56,9 +56,11 @@ + + From 7be23ed2854c81de7f0a1775f910bd7a04635e4f Mon Sep 17 00:00:00 2001 From: George Peter Banyard Date: Thu, 5 Oct 2023 01:14:57 +0100 Subject: [PATCH 2/2] Describe decrement range value error better --- reference/strings/functions/str-decrement.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/strings/functions/str-decrement.xml b/reference/strings/functions/str-decrement.xml index 2f73da230098..07933ae75c3d 100644 --- a/reference/strings/functions/str-decrement.xml +++ b/reference/strings/functions/str-decrement.xml @@ -53,7 +53,8 @@ A ValueError is thrown if - string is out of the decrement range. + string cannot be decremented. + For example, "A" or "0".