Módulo
Contido
Índice 🔎︎

# AscW Function [VBA]

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

Esta función ou constante actívase coa instrución Option VBASupport 1 colocada antes do código de programa executábel dun módulo.

## Sintaxe:

    AscW (Text As String)

## Valor de retorno:

Enteiro

## Parámetros:

Text: 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, LibreOffice Basic reports a run-time error. Returned values are between 0 and 65535.

## Códigos de erro

5 Chamada de procedemento incorrecta

## Exemplo:

    Sub ExampleAscW
     Print AscW("A") ' returns 65
     Print AscW("Ω") ' returns 937
     Print AscW("Αθήνα") ' returns 913, since only the first character (Alpha) is taken into account
    End Sub

Temas relacionados

Chr

ChrW

Asc