VB ASC Function: Get ASCII Values in Visual Basic
In VB, the ASC function is used to return the ASCII value of the first character in a string. Its syntax is:
Convert a string to its ASCII value.
In this case, the string is a string that returns the ASCII value of the first character.
For example, the following example demonstrates how to use the ASC function to obtain the ASCII value of the first character in the string “Hello”:
Dim firstChar As Integer
firstChar = Asc("Hello")
MsgBox "The ASCII value of the first character is: " & firstChar
The above code will display a message box that shows the ASCII value of the first character “H” in the string “Hello” as 72.