April 2002
Intermediate to advanced
688 pages
19h 51m
English
CChar Function
No
CChar(expression)expression (required; String)Any string expression
A value of type Char
Converts the first character in a string
expression to a Char data type
CChar extracts the first character of expression and converts it to a Char data type.
MsgBox(CChar("abc")) ' Displays a
MsgBox(CChar("56")) ' Displays 5If you wish to convert a numeric code to its corresponding Char data type, use the ChrW function.
Like most of the conversion functions, CChar is not actually a function in the Microsoft.VisualBasic namespace. Instead, it is similar to a Visual C++ macro; the compiler translates the function call into inline code.
Read now
Unlock full access