From eb45e7df8aeeab7791876038c16345d5321e49b1 Mon Sep 17 00:00:00 2001 From: Alain Romedenne Date: Mon, 8 Nov 2021 17:13:13 +0200 Subject: tdf#141474 Asc, AscW function signatures Change-Id: Ia85bf08bb1e5cb0e7db5717caec01e7e50c3b106 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/124853 Tested-by: Jenkins Reviewed-by: Olivier Hallot --- source/text/sbasic/shared/03120101.xhp | 25 +++++++++++++------------ source/text/sbasic/shared/03120102.xhp | 15 ++++++++------- source/text/sbasic/shared/03120111.xhp | 18 +++++++++--------- source/text/sbasic/shared/03120112.xhp | 14 +++++++------- 4 files changed, 37 insertions(+), 35 deletions(-) diff --git a/source/text/sbasic/shared/03120101.xhp b/source/text/sbasic/shared/03120101.xhp index d5e7a7eaf0..f2f403e088 100644 --- a/source/text/sbasic/shared/03120101.xhp +++ b/source/text/sbasic/shared/03120101.xhp @@ -33,36 +33,37 @@ Asc function - -Asc Function -Returns the ASCII (American Standard Code for Information Interchange) value of the first character in a string expression. +

Asc Function

+Returns the ASCII (American Standard Code for Information Interchange) value of the first character in a string expression. -Syntax: + -Asc (Text As String) +Asc(string) As Long -Return value: -Integer + +Long -Parameters: - Text: Any valid string expression. Only the first character in the string is relevant. + +string: Any valid string expression. Only the first character in the string is relevant. Use the Asc function to replace keys with values. If the Asc function encounters a blank string, $[officename] Basic reports a run-time error. In addition to 7 bit ASCII characters (Codes 0-127), the ASCII function can also detect non-printable key codes in ASCII code. This function can also handle 16 bit unicode characters. -Example: + Sub ExampleASC Print ASC("A") ' returns 65 - Print ASC("Z") ' returns 90 + Print ASC(string:="Z") ' returns 90 Print ASC("Las Vegas") ' returns 76, since only the first character is taken into account End Sub
-CHR + + +
diff --git a/source/text/sbasic/shared/03120102.xhp b/source/text/sbasic/shared/03120102.xhp index a9d73261ef..5f3a8f3592 100644 --- a/source/text/sbasic/shared/03120102.xhp +++ b/source/text/sbasic/shared/03120102.xhp @@ -30,19 +30,18 @@ Chr function - Chr Function - Returns the character that corresponds to the specified character code. +

Chr Function

+ Returns the character that corresponds to the specified character code. - - Chr(Expression As Integer) + Chr[$](expression As Integer) As String String - Expression: a numeric expression that represents a valid 8-bit ASCII value (0-255) or a 16-bit Unicode value. (To support expressions with a nominally negative argument like Chr(&H8000) in a backwards-compatible way, values in the range −32768 to −1 are internally mapped to the range 32768 to 65535.) + Expression: a numeric expression that represents a valid 8-bit ASCII value (0-255) or a 16-bit Unicode value. (To support expressions with a nominally negative argument like Chr(&H8000) in a backwards-compatible way, values in the range −32768 to −1 are internally mapped to the range 32768 to 65535.) When VBA compatibility mode is enabled (OPTION VBASUPPORT 1), Expression is a numeric expression that represents a valid 8-bit ASCII value (0-255) only. @@ -56,13 +55,15 @@ Sub ExampleChr ' This example inserts quotation marks (ASCII value 34) in a string. - MsgBox "A "+ Chr$(34)+"short" + Chr$(34)+" trip." + MsgBox "A "+ Chr$(34)+"short" + Chr(34)+" trip." ' The printout appears in the dialog as: A "short" trip. End Sub
- ASC + + +
diff --git a/source/text/sbasic/shared/03120111.xhp b/source/text/sbasic/shared/03120111.xhp index 4ee05ef530..96d211f72f 100644 --- a/source/text/sbasic/shared/03120111.xhp +++ b/source/text/sbasic/shared/03120111.xhp @@ -34,18 +34,18 @@ -AscW Function [VBA] -Returns the Unicode value of the first character in a string expression. +

AscW Function [VBA]

+Returns the Unicode value of the first character in a string expression. -AscW (Text As String) +AscW (string) As Long -Integer +Long - Text: Any valid string expression. Only the first character in the string is relevant. + string: Any valid string expression. Only the first character in the string is relevant. Use the AscW function to replace keys with Unicode values. If the AscW function encounters a blank string, %PRODUCTNAME Basic reports a run-time error. Returned values are between 0 and 65535. @@ -53,15 +53,15 @@ Sub ExampleAscW Print AscW("A") ' returns 65 - Print AscW("Ω") ' returns 937 + Print AscW(string:="Ω") ' returns 937 Print AscW("Αθήνα") ' returns 913, since only the first character (Alpha) is taken into account End Sub
-Chr -ChrW -Asc + + +
diff --git a/source/text/sbasic/shared/03120112.xhp b/source/text/sbasic/shared/03120112.xhp index 39f9cebee0..05d2b8297e 100644 --- a/source/text/sbasic/shared/03120112.xhp +++ b/source/text/sbasic/shared/03120112.xhp @@ -34,13 +34,13 @@ -ChrW Function [VBA] -Returns the Unicode character that corresponds to the specified character code. +

ChrW Function [VBA]

+Returns the Unicode character that corresponds to the specified character code. -ChrW(Expression As Integer) +ChrW(Expression As Integer) As String String @@ -59,10 +59,10 @@
-Chr -Asc -AscW + + +
- + \ No newline at end of file -- cgit