NQhzV‖

4NGHc‖AscW Function [VBA]

XujWF‖Returns the Unicode value of the first character in a string expression.

warning

R9TFi‖This constant, function or object is enabled with the statement Option VBASupport 1 placed before the executable program code in a module.


FVEx2‖Syntax:


AscW (string) As Long

GePPP‖Return value:

Long

WADQ4‖Parameters:

GCkrz‖ string: Any valid string expression. Only the first character in the string is relevant.

PWbGW‖Use the AscW function to replace keys with Unicode values. If the AscW function encounters a blank string, LibreOfficeDev Basic reports a run-time error. Returned values are between 0 and 65535.

SEjHR‖Error codes:

5 Invalid procedure call

EFSA4‖Example:


Sub ExampleAscW
8AUfu‖ Print AscW("A") ' returns 65
jSckN‖ Print AscW(string:="Ω") ' returns 937
YqiAc‖ Print AscW("Αθήνα") ' returns 913, since only the first character (Alpha) is taken into account
End Sub